home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / ssd40.zip / SSD.DOC < prev    next >
Text File  |  1996-04-19  |  137KB  |  2,977 lines

  1.  
  2.                            
  3.                            SERVILE SOFTWARE DECODER
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                   Version 4.0
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.                          Shareware Version Disk Manual
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. 2
  24.                                   DISCLAIMER
  25.  
  26.  
  27.  
  28. The Servile Software Decoder is supplied as a tool to assist in the reverse-
  29. engineering of IBM PC software, with special attention to computer viruses. 
  30. Because of the nature of the subject, no guarrantees can be made that a 
  31. program analysed with SSD will behave in the same manner when executed outside 
  32. of the SSD environment. 
  33.  
  34. Years of development and rigourous testing have gone into SSD, including 
  35. testing it on hundreds of Shareware, freeware and commercial programs, 
  36. including computer viruses. Some programs, by their nature, exhibit pecuiliar 
  37. behaviour when analysed with SSD which they do not exhibit otherwise. 
  38.  
  39. Use of SSD is at your own risk. The author accepts no liability in any form 
  40. and makes no guarrantees as to the suitability of this product for any purpose 
  41. what so ever. 
  42.  
  43. Please note that in particular some software may bypass SSD's safety measures 
  44. and could damage data or hardware. It is impossible to make a completely safe 
  45. environment for testing malicious software.
  46.  
  47. 3
  48.                                  INTRODUCTION
  49.  
  50.  
  51.  
  52.  
  53.  
  54. The Servile Software Decoder (SSD) is a powerful code and program analyser for 
  55. the IBM PC. SSD is neither a disassembler nor a debugger, although it shares 
  56. some similarities with both. Unlike a disassembler, SSD activately analyses 
  57. the code of a program, this allows SSD to analyse encrypted programs, unlike a 
  58. disassemler. Unlike a debugger, SSD interprets the program under analysis. 
  59. This has the advantage that SSD is safe to use with computer viruses as 
  60. dangerous commands are inhibited. It also implies that SSD is not prone to 
  61. anti-debugger instructions which are often contained in computer viruses. 
  62.  
  63. Because SSD interprets programs, rather than passing them straight to DOS for 
  64. execution, some programs may exhibit slightly different behaviour when 
  65. analysed than when executed. This is unfortunately unavoidable.
  66.  
  67. When SSD starts execution, or loads a new file, the PC interrupt vector table 
  68. is copied into memory. All subsequent reads and writes to the first 1024 bytes 
  69. of RAM (vector table) are then redirected to the SSD copy of the interrupt 
  70. vector table. This allows programs to think they have changed an interrupt  
  71. vector, but at the same time retains security by not changing the real vector.
  72.  
  73.  
  74. Execute            Record             Utility               File            Exit
  75.                                                                                 
  76. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  77. ║                            ║                                                 ║
  78. ║                            ║                                                 ║
  79. ║                            ║                                                 ║
  80. ║                            ║                                                 ║
  81. ║                       ╔════════════About═════════════╗                       ║
  82. ║                       ║   Servile Software Decoder   ║                       ║
  83. ║                       ║                              ║                       ║
  84. ║                       ║         Version 4.0          ║                       ║
  85. ║                       ║     (Shareware Version)      ║                       ║
  86. ║                       ║                              ║                       ║
  87. ║                       ║     Copyright (c)1996 by     ║                       ║
  88. ║                       ║                              ║                       ║
  89. ║                       ║       Servile Software       ║                       ║
  90. ║                       ╚══════════════════════════════╝                       ║
  91. ║                            ║                                                 ║
  92. ║                            ║                                                 ║
  93. ║                            ║                                                 ║
  94. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  95. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  96. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  97. ║                                                                     ZCSOAPD  ║
  98. ╚═════════Registers════════════════════════════════════════════════════════════╝
  99.  
  100. 4
  101.                                     DISPLAY
  102.  
  103.  
  104.  
  105. SSD uses two display pages. Page 0, the normal default DOS display page is 
  106. used for output from the program being analysed. Page 1 is used for the SSD 
  107. main display which is divided into the following component parts: Menu bar, 
  108. containing drop-down menus of facilities. Code window, which displays the 
  109. dissasembly of each instruction as it occurs. Analysis window, which displays 
  110. analysis information about the running program and also data dumps when 
  111. requested. And the registers window which displays the current contents of the 
  112. CPU registers as they appear to the program being analysed. 
  113.  
  114.  
  115.  
  116.  
  117. Execute            Record             Utility               File            Exit
  118.                                                                                 
  119. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  120. ║                            ║                                                 ║
  121. ║                            ║                                                 ║
  122. ║                            ║                                                 ║
  123. ║                            ║                                                 ║
  124. ║                            ║                                                 ║
  125. ║                            ║                                                 ║
  126. ║                            ║                                                 ║
  127. ║                            ║                                                 ║
  128. ║                            ║                                                 ║
  129. ║                            ║                                                 ║
  130. ║                            ║                                                 ║
  131. ║                            ║                                                 ║
  132. ║                            ║                                                 ║
  133. ║                            ║                                                 ║
  134. ║                            ║                                                 ║
  135. ║                            ║                                                 ║
  136. ║                            ║                                                 ║
  137. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  138. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  139. ║  CS  4B4B   DS  4B4B   ES  0000   SS  4C8D   SP  0200   IP  0100    0000000  ║
  140. ║  4B4B:0423  01 A5 12 48 00 E9                                       ZCSOAPD  ║
  141. ╚═════════Registers════════════════════════════════════════════════════════════╝
  142. 5
  143.                                   FACILITIES
  144.  
  145.  
  146. This section describes the various facilities available from the drop-down 
  147. menus. Each menu is tackled in turn, with the menu name shown in CAPITALS, 
  148. followed by the facilities available from that menu.
  149.  
  150.  
  151.  
  152. Execute:
  153.  
  154. The "Execute" menu provides access to the various facilities for "running" the 
  155. loaded program. In brief, the loaded program may be single stepped, run at 
  156. maximum speed or traced at three different speeds. A program which is being 
  157. either traced or run may be stopped by pressing the Esc key. When single 
  158. stepping a program each instruction is fetched and interpreted and then 
  159. execution pauses. You may then repeatedly press return whilst the "Step" 
  160. prompt is highlighted to facilitate single-stepping through the code.
  161.  
  162.  
  163. Execute            Record             Utility               File            Exit
  164. ╔════════╗                                                                      
  165. ║ Step   ║══Trace════════════╦════════════════════Analysis═════════════════════╗
  166. ║ Run    ║                   ║                                                 ║
  167. ║ Slow   ║                   ║                                                 ║
  168. ║ Medium ║                   ║                                                 ║
  169. ║ Fast   ║                   ║                                                 ║
  170. ╚════════╝                   ║                                                 ║
  171. ║                            ║                                                 ║
  172. ║                            ║                                                 ║
  173. ║                            ║                                                 ║
  174. ║                            ║                                                 ║
  175. ║                            ║                                                 ║
  176. ║                            ║                                                 ║
  177. ║                            ║                                                 ║
  178. ║                            ║                                                 ║
  179. ║                            ║                                                 ║
  180. ║                            ║                                                 ║
  181. ║                            ║                                                 ║
  182. ║                            ║                                                 ║
  183. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  184. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  185. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  186. ║                                                                     ZCSOAPD  ║
  187. ╚═════════Registers════════════════════════════════════════════════════════════╝
  188.  
  189.  
  190. 6
  191. Step:
  192.  
  193. Single step the loaded program. Only the next instruction is interpreted, and 
  194. then SSD returns to the Execute menu.
  195.  
  196. Run:
  197.  
  198. Run the program at maximum speed. SSD does not display the results of
  199. the analysis, but will echo all selected "trace" output analysis to the 
  200. selected file as normal. This allows a program to be executed at the fastest 
  201. possible speed and then the analysis may be reviewed later.
  202.  
  203. Slow:
  204.  
  205. Trace the program slowly. As each instruction is fetched and interpreted, it's 
  206. dissamembly and any resulting analysis are displayed along with the new 
  207. contents of all the registers. However, should the program be in a loop 
  208. command, only the effect upon the registers is displayed untill the loop 
  209. finishes. When looping the "trace" window will appear to pause, but the 
  210. "registers" window will be animated displaying the changes to the registers 
  211. during the loop (most commonly CX will increment or decrement by single 
  212. values).
  213.  
  214. Medium:
  215.  
  216. Trace the program fairly slowly. As each instruction is fetched and 
  217. interpreted, its dissamembly and analysis are displayed togther with the new 
  218. contents of all the registers. However, should the program be in a loop 
  219. command, only the effect upon the registers is displayed untill the loop 
  220. finishes. 
  221.  
  222. Fast:
  223.  
  224. Trace the program quickly. As each instruction is fetched and interpreted, its 
  225. dissamembly and analysis are displayed togther with the new contents of all 
  226. the registers. However, should the program be in a loop command, only the 
  227. effect upon the registers is displayed untill the loop finishes. 
  228.  
  229.  
  230. 7
  231. RECORD:
  232.  
  233. Toggle which trace and analysis details will be echoed to an output file. The 
  234. details are cumulative. Selecting an option low in the list will result in 
  235. details higher in the list also being recorded. Selecting the "Code & Regs" 
  236. option results in all trace and analysis details being recorded. 
  237.  
  238. A tick (√) appears next to the currently selected level of recording.
  239.  
  240. SSD requires you to enter a name of a file to which the details will be 
  241. echoed. If you want the details echoed to the printer directly, rather than 
  242. to a disk file, then enter the file name PRN. This can be useful for tracing 
  243. code which destroys the display, such as tracing interrupt 10h for example. 
  244. Notice that if the printer is switched off, off-line or out-of-paper SSD will 
  245. continue regardless, but nothing will be echoed to the printer until the 
  246. problem is resolved. 
  247.  
  248.  
  249. Execute            Record             Utility               File            Exit
  250.                    ╔══════════════╗                                             
  251. ╔═══════════Trace══║ √None        ║═══════════════Analysis═════════════════════╗
  252. ║                  ║  Analysis    ║                                            ║
  253. ║                  ║  Code        ║                                            ║
  254. ║                  ║  Code & Regs ║                                            ║
  255. ║                  ╚══════════════╝                                            ║
  256. ║                            ║                                                 ║
  257. ║                            ║                                                 ║
  258. ║                            ║                                                 ║
  259. ║                            ║                                                 ║
  260. ║                            ║                                                 ║
  261. ║                            ║                                                 ║
  262. ║                            ║                                                 ║
  263. ║                            ║                                                 ║
  264. ║                            ║                                                 ║
  265. ║                            ║                                                 ║
  266. ║                            ║                                                 ║
  267. ║                            ║                                                 ║
  268. ║                            ║                                                 ║
  269. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  270. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  271. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  272. ║                                                                     ZCSOAPD  ║
  273. ╚═════════Registers════════════════════════════════════════════════════════════╝
  274.                     The Record Menu (no recording selected)
  275.                                                                                 
  276.                                                                                 
  277. 8
  278. UTILITY:
  279.  
  280. Miscellaneous utility facilities.
  281.  
  282. About....: 
  283.  
  284. Displays information about SSD. After reading the information displayed, press 
  285. any key to remove the "about" window from the display. 
  286.  
  287. Change Regs:
  288.  
  289. Allows any register value to be changed. Highlight the required register, and 
  290. press return to enter a new value.
  291.  
  292. Trace Int:
  293.  
  294. Allows an interrupt to be specified instead of a program. To trace the 
  295. interrupt use the Execute facilities as for a program. (CS and IP are set to 
  296. the values stored in the appropriate interrupt vector). In effect, the ROM 
  297. code pointed to by the interrupt vector may be viewed like a COM file, but 
  298. rather than loading it with the "file" facility, you load it with the "Trace 
  299. Int." facility. SSD sets execution to commence at the start of the code - just 
  300. as it does when you load a program.
  301.  
  302. For Example; if you want to trace interrupt 10 you should first select the 
  303. Trace Int facility from the Utility menu and enter the number, in hexadecimal 
  304. notation, of the interrup to trace. In this case 10. Then set the registers to 
  305. any required values. Finally the interrupt may be called and traced with the 
  306. Execute facilities: Step, Slow etc.
  307.  
  308.  
  309. Dump:
  310.  
  311. Display the values in RAM at a specified segment:offset address. Registers may 
  312. be specified for the address, eg: es:di is a valid address. This facility is 
  313. typically used to view messages within encrypted programs, thus allowing the 
  314. true identity of encrypted computer viruses to be determined. You may also 
  315. like to execute an encrypted .COM program until it finishes decrypting and 
  316. then use the "write" facility to write the memory image to disk where from you 
  317. may view it using a hex disk editor.
  318.  
  319. Watch:
  320.  
  321. The Watch facility is similar Dump, but displays the six bytes at the 
  322. specified address. These bytes are reread and displayed as the program is 
  323. executed - like the register's display. This allows you to watch the values at 
  324. a specified memory address. The data is displayed as the segment:offset of the 
  325. address followed by each data byte in hexadecimal format.
  326.  
  327.  
  328. Output:
  329.  
  330. Display the program's output screen. Press a key to return to the analysis 
  331. screen.
  332.  
  333. Interrupts:
  334.  
  335. Displays the values recorded in the interrupt vector table (SSD's copy). The 
  336. listing is displayed onescreen page at a time. To continue the listing press 
  337. any key except the Esc key, pressing the Esc key will terminate the listing. 
  338.  
  339. 9
  340. Execute            Record             Utility               File            Exit
  341.                                       ╔═════════════╗                           
  342. ╔═══════════Trace════════════╦════════║ About....   ║lysis═════════════════════╗
  343. ║                            ║        ║ Change Regs ║                          ║
  344. ║                            ║        ║ Trace Int   ║                          ║
  345. ║                            ║        ║ Dump        ║                          ║
  346. ║                            ║        ║ Watch       ║                          ║
  347. ║                            ║        ║ Output      ║                          ║
  348. ║                            ║        ║ Interrupts  ║                          ║
  349. ║                            ║        ╚═════════════╝                          ║
  350. ║                            ║                                                 ║
  351. ║                            ║                                                 ║
  352. ║                            ║                                                 ║
  353. ║                            ║                                                 ║
  354. ║                            ║                                                 ║
  355. ║                            ║                                                 ║
  356. ║                            ║                                                 ║
  357. ║                            ║                                                 ║
  358. ║                            ║                                                 ║
  359. ║                            ║                                                 ║
  360. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  361. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  362. ║  CS  4B4B   DS  4B4B   ES  4B4B   SS  4C8D   SP  0200   IP  0100    0000000  ║
  363. ║                                                                     ZCSOAPD  ║
  364. ╚═════════Registers════════════════════════════════════════════════════════════╝
  365.  
  366. 10
  367. FILE:
  368.  
  369. The "File" menu provides facilities for opening and writing program files and 
  370. also for specifying command line arguments to be supplied to the program 
  371. under analysis. 
  372.  
  373. Open:
  374.  
  375. Allows you to specify a program to load and analyse. You may also specify the 
  376. name of a program on the command line when you start SSD, for example:
  377.  
  378.                                 SSD myprog.exe
  379.  
  380. Write:
  381.  
  382. Writes a memory image of the current .COM program to disk. As EXE files 
  383. are not binary images (they contain redirection code for example) they cannot 
  384. be written to disk and an error is reported if the loaded program is a .EXE 
  385. program and you try to write the memory image to disk. This facility is used 
  386. for decoding and unencrypting .COM files which may then be written to disk for 
  387. disassembly with more traditional tools such as "Sourcer" and "The Interactive 
  388. Disassembler". 
  389.  
  390.  
  391. 11
  392. Arguments:
  393.  
  394. Allows command line arguments to be specified. These are then passed to the 
  395. program being analysed. For example; if a program normally expects a command 
  396. line to include parameters, such as the DOS "type" command, as in 
  397.  
  398.                                TYPE myfile.doc
  399.  
  400. Then you may need to supply command line arguments to the program when 
  401. analysing it with SSD. This facility allows you to do this.
  402.  
  403.                                                                                 
  404. Execute            Record             Utility               File            Exit
  405.                                                             ╔═══════════╗       
  406. ╔═══════════Trace════════════╦════════════════════Analysis══║ Open      ║══════╗
  407. ║                            ║                              ║ Write     ║      ║
  408. ║                            ║                              ║ Arguments ║      ║
  409. ║                            ║                              ╚═══════════╝      ║
  410. ║                            ║                                                 ║
  411. ║                            ║                                                 ║
  412. ║                            ║                                                 ║
  413. ║                            ║                                                 ║
  414. ║                            ║                                                 ║
  415. ║                            ║                                                 ║
  416. ║                            ║                                                 ║
  417. ║                            ║                                                 ║
  418. ║                            ║                                                 ║
  419. ║                            ║                                                 ║
  420. ║                            ║                                                 ║
  421. ║                            ║                                                 ║
  422. ║                            ║                                                 ║
  423. ║                            ║                                                 ║
  424. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  425. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  426. ║  CS  53C8   DS  53B8   ES  53B8   SS  552C   SP  0080   IP  0000    0000000  ║
  427. ║                                                                     ZCSOAPD  ║
  428. ╚═════════Registers════════════════════════════════════════════════════════════╝
  429.                                  The File Menu
  430.  
  431. EXIT:
  432.  
  433. Returns to DOS. When you have finished analysing programs select this option 
  434. to exit SSD and return to the operating system.
  435. 12
  436.                                    USING SSD
  437.  
  438.  
  439. SSD may be started with an optional command line parameter describing a 
  440. program to be loaded and analysed. This program may include a path statement 
  441. such as:
  442.  
  443.                             SSD C:\TEST\MYPROG.EXE
  444.  
  445. Also the program need not be suffixed with the usual .EXE or .COM as required 
  446. by DOS. SSD will attempt to load and interpret any file specified, for 
  447. example:
  448.  
  449.                                SSD C:\MYBOOT.BIN
  450.  
  451. Will cause SSD to start and load the file "myboot.bin" from the root directory 
  452. of drive C. If this file is a valid binary image, such as a capture of a disk 
  453. boot sector program, then it may be traced and analysed with SSD.
  454.  
  455.  
  456. 13
  457.                                     EXAMPLE
  458.  
  459.  
  460. Tracing a boot sector virus:
  461.  
  462. In order to trace a boot sector virus one must first capture the boot sector 
  463. into a file, using a tool such as Servile Software's "Getboot" facility. The 
  464. created file may then be treated like a COM file.
  465.  
  466. For example. Say you have captured the ExeBug virus into a file named 
  467. "exebug.bin". This may then be traced through SSD as follows. First start SSD 
  468. with the command line: 
  469.  
  470.                                 SSD exebug.bin
  471.  
  472.  
  473. You may then use the step command to follow each command, as illustrated in 
  474. the following screen shots:
  475.  
  476. Execute            Record             Utility               File            Exit
  477.                                                                                 
  478. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  479. ║0100 jmp short 011E         ║                                                 ║
  480. ║                            ║                                                 ║
  481. ║                            ║                                                 ║
  482. ║                            ║                                                 ║
  483. ║                            ║                                                 ║
  484. ║                            ║                                                 ║
  485. ║                            ║                                                 ║
  486. ║                            ║                                                 ║
  487. ║                            ║                                                 ║
  488. ║                            ║                                                 ║
  489. ║                            ║                                                 ║
  490. ║                            ║                                                 ║
  491. ║                            ║                                                 ║
  492. ║                            ║                                                 ║
  493. ║                            ║                                                 ║
  494. ║                            ║                                                 ║
  495. ║                            ║                                                 ║
  496. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  497. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  498. ║  CS  507A   DS  507A   ES  507A   SS  507A   SP  FFFE   IP  011E    0000000  ║
  499. ║                                                                     ZCSOAPD  ║
  500. ╚═════════Registers════════════════════════════════════════════════════════════╝
  501.                                 Tracing ExeBug
  502.  
  503.  
  504. 14
  505. Execute            Record             Utility               File            Exit
  506.                                                                                 
  507. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  508. ║0100 jmp short 011E         ║                                                 ║
  509. ║011E xor ax,ax              ║                                                 ║
  510. ║                            ║                                                 ║
  511. ║                            ║                                                 ║
  512. ║                            ║                                                 ║
  513. ║                            ║                                                 ║
  514. ║                            ║                                                 ║
  515. ║                            ║                                                 ║
  516. ║                            ║                                                 ║
  517. ║                            ║                                                 ║
  518. ║                            ║                                                 ║
  519. ║                            ║                                                 ║
  520. ║                            ║                                                 ║
  521. ║                            ║                                                 ║
  522. ║                            ║                                                 ║
  523. ║                            ║                                                 ║
  524. ║                            ║                                                 ║
  525. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  526. ║  AX  0000   BX  0000   CX  0000   DX  0000   SI  0000   DI  0000   BP  0000  ║
  527. ║  CS  507A   DS  507A   ES  507A   SS  507A   SP  FFFE   IP  0120    1000010  ║
  528. ║                                                                     ZCSOAPD  ║
  529. ╚═════════Registers════════════════════════════════════════════════════════════╝
  530.                                 Tracing ExeBug
  531.  
  532. Execute            Record             Utility               File            Exit
  533.                                                                                 
  534. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  535. ║0100 jmp short 011E         ║                                                 ║
  536. ║011E xor ax,ax              ║                                                 ║
  537. ║0120 mov ds,ax              ║                                                 ║
  538. ║0122 mov di,ax              ║                                                 ║
  539. ║0124 mov ss,ax              ║                                                 ║
  540. ║0126 mov sp,7C00            ║                                                 ║
  541. ║0129 mov cl,06              ║                                                 ║
  542. ║012B mov si,sp              ║                                                 ║
  543. ║012D mov bx,sp              ║                                                 ║
  544. ║012F les ax,[004C]          ║                                                 ║
  545. ║0133 mov [7CAD],ax          ║                                                 ║
  546. ║0136 mov ax,[0413]          ║                                                 ║
  547. ║0139 mov [7CAF],es          ║                                                 ║
  548. ║013D dec ax                 ║                                                 ║
  549. ║013E mov [0413],ax          ║                                                 ║
  550. ║0141 shl ax,cl              ║                                                 ║
  551. ║                            ║                                                 ║
  552. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  553. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  554. ║  CS  507A   DS  0000   ES  08A9   SS  0000   SP  7C00   IP  0143    0011100  ║
  555. ║                                                                     ZCSOAPD  ║
  556. ╚═════════Registers════════════════════════════════════════════════════════════╝
  557.                                 Tracing ExeBug
  558.  
  559.  
  560. 15
  561. Execute            Record             Utility               File            Exit
  562.                                                                                 
  563. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  564. ║0122 mov di,ax              ║Set vector 13 segment to 0122:                   ║
  565. ║0124 mov ss,ax              ║                                                 ║
  566. ║0126 mov sp,7C00            ║                                                 ║
  567. ║0129 mov cl,06              ║                                                 ║
  568. ║012B mov si,sp              ║                                                 ║
  569. ║012D mov bx,sp              ║                                                 ║
  570. ║012F les ax,[004C]          ║                                                 ║
  571. ║0133 mov [7CAD],ax          ║                                                 ║
  572. ║0136 mov ax,[0413]          ║                                                 ║
  573. ║0139 mov [7CAF],es          ║                                                 ║
  574. ║013D dec ax                 ║                                                 ║
  575. ║013E mov [0413],ax          ║                                                 ║
  576. ║0141 shl ax,cl              ║                                                 ║
  577. ║0143 mov es,ax              ║                                                 ║
  578. ║0145 push ax                ║                                                 ║
  579. ║0146 mov [004C],0122        ║                                                 ║
  580. ║                            ║                                                 ║
  581. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  582. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  583. ║  CS  507A   DS  0000   ES  9F80   SS  0000   SP  7BFE   IP  014C    0011100  ║
  584. ║                                                                     ZCSOAPD  ║
  585. ╚═════════Registers════════════════════════════════════════════════════════════╝
  586.             Tracing ExeBug - A crafty write to the BIOS disk vector
  587.  
  588.  
  589. Execute            Record             Utility               File            Exit
  590.                                                                                 
  591. ╔═══════════Trace════════════╦════════════════════Analysis═════════════════════╗
  592. ║0124 mov ss,ax              ║Set vector 13 segment to 0122:                   ║
  593. ║0126 mov sp,7C00            ║Set vector 13 offset to :9F80                    ║
  594. ║0129 mov cl,06              ║                                                 ║
  595. ║012B mov si,sp              ║                                                 ║
  596. ║012D mov bx,sp              ║                                                 ║
  597. ║012F les ax,[004C]          ║                                                 ║
  598. ║0133 mov [7CAD],ax          ║                                                 ║
  599. ║0136 mov ax,[0413]          ║                                                 ║
  600. ║0139 mov [7CAF],es          ║                                                 ║
  601. ║013D dec ax                 ║                                                 ║
  602. ║013E mov [0413],ax          ║                                                 ║
  603. ║0141 shl ax,cl              ║                                                 ║
  604. ║0143 mov es,ax              ║                                                 ║
  605. ║0145 push ax                ║                                                 ║
  606. ║0146 mov [004C],0122        ║                                                 ║
  607. ║014C mov [004E],ax          ║                                                 ║
  608. ║                            ║                                                 ║
  609. ╠════════════════════════════╩═════════════════════════════════════════════════╣
  610. ║  AX  9F80   BX  7C00   CX  0006   DX  0000   SI  7C00   DI  0000   BP  0000  ║
  611. ║  CS  507A   DS  0000   ES  9F80   SS  0000   SP  7BFE   IP  014F    0011100  ║
  612. ║                                                                     ZCSOAPD  ║
  613. ╚═════════Registers════════════════════════════════════════════════════════════╝
  614.             Tracing ExeBug - A crafty write to the BIOS disk vector
  615.  
  616.  
  617. 16
  618.                               INHIBITED COMMANDS
  619.  
  620.  
  621.  
  622. SSD inhibits all attempts to disable hardware by writing to I/O ports, 
  623. generation of audible tones, attempts to create new files, closing of the 
  624. standard files; stdin, stdout, stderr, stdaux and stdprn, write to disk and 
  625. disk formatting instructions. Instructions which attempt to write to memory 
  626. occupied by SSD are also rejected. 
  627.  
  628. Inhibiting operations allows a greater degree of safety when analysing 
  629. computer viruses, but has the disadvantage that subsequent program behaviour 
  630. may be altered in some circumstances.
  631.  
  632. SSD inhibits attempts to change the following interrupt vectors:
  633.  
  634. 08, 0A, 0B, 0C, 0D, 0E, 0F, 1C, 21, 24, 70
  635.  
  636. However, subsequent reads of these vectors will return a value as though the 
  637. change had occured.
  638. 17
  639.                                 DOS ERROR CODES
  640.  
  641.  
  642. DOS error codes are usually returned in the AX register following an abortive 
  643. DOS interrupt call, usually indicated by a set carry flag.
  644.  
  645.  
  646. Code    Meaning
  647.  
  648.  01     Invalid function
  649.  02     File not found
  650.  03     Path not found
  651.  04     No handles available
  652.  05     Access denied
  653.  06     Invalid handle
  654.  07     Memory control blocks destroyed
  655.  08     Insufficient memory
  656.  09     Invalid memory block address
  657.  0A     Invalid environment
  658.  0B     Invalid format
  659.  0C     Invalid access code
  660.  0D     Invalid data
  661.  0F     Invalid drive
  662.  10     Attempt to remove current directory
  663.  11     Not the same device
  664.  12     No more files
  665.  13     Disk write-protected
  666.  14     Unknown unit
  667.  15     Drive not ready
  668.  16     Unknown command
  669.  17     CRC error
  670.  18     Bad request structure length
  671.  19     Seek error
  672.  1A     Unknown media type
  673.  1B     Sector not found
  674.  1C     Out of paper
  675.  1D     Write fault
  676.  1E     Read fault
  677.  1F     General failure
  678.  20     Sharing violation
  679.  21     Lock violation
  680.  22     Invalid disk change
  681.  23     FCB unavailable
  682.  24     Sharing buffer overflow
  683.  
  684.  
  685.  
  686. 18
  687.                                   MEMORY MAP
  688.  
  689.  
  690. The following table describes the layout of conventional RAM (memory) within 
  691. the IBM PC and compatibles. Each address is shown in the format 
  692. segment:offset, as is conventional with Intel's approach to memory addressing 
  693. with the 8080 family of CPUs. 
  694.  
  695.  
  696.  
  697. 0000:0000               RAM
  698.                         Vector Table
  699.                         256 entries stored as segment word
  700.                                                offset word
  701.  
  702. 0040:0000               BIOS data area
  703.     :0000               Base I/O address of 1st serial I/O port, zero if none
  704.     :0002               Base I/O address of 2nd serial I/O port, zero if none
  705.     :0004               Base I/O address of 3rd serial I/O port, zero if none
  706.     :0006               Base I/O address of 4th serial I/O port, zero if none
  707.     :0008               Base I/O address of 1st parallel I/O port, zero if none
  708.     :000A               Base I/O address of 2nd parallel I/O port, zero if none
  709.     :000C               Base I/O address of 3rd parallel I/O port, zero if none
  710.     :000E               Base I/O address of 4th parallel port, zero if none
  711.                         Segment of Extended BIOS Data Segment (PS/2)
  712.     :0010               Installed hardware
  713.     :0012               POST status
  714.     :0013               Base memory size in kbytes (0-640)
  715.     :0015               Manufacturing test scratch pad
  716.     :0016               Manufacturing test scratch pad
  717.                         BIOS control flags (PS/2 mod 30)
  718.                         Keyclick loudness 00h-7Fh (Compaq Deskpro 386K)
  719.     :0017               Keyboard status flags 1
  720.     :0018               Keyboard status flags 2
  721.     :0019               Keyboard: Alt-nnn keypad workspace
  722.     :001A               Keyboard: ptr to next character in keyboard buffer
  723.     :001C               Keyboard: ptr to first free slot in keyboard buffer
  724.     :001E               Keyboard circular buffer 
  725.     :003E               Diskette recalibrate status
  726.     :003F               Diskette motor status
  727.     :0040               Diskette motor turn-off time-out count
  728.     :0041               Diskette last operation status
  729.     :0042               XT: command byte to hard disk controller
  730.                         AT: write precompensation cylinder number / 4
  731.     :0043               XT: bit 5 = drive number, bits 3-0=head number
  732.                         AT: sector count
  733.     :0044               XT: bits 6,7 = high bits of track, bits 5-0 = start 
  734.                             sector-1 
  735.                         AT: starting sector
  736.     :0045               low byte of track number
  737.     :0046               XT: sector count
  738.                         AT: high bits of track number
  739.     :0047               XT: control byte from HD parameters (step rate,...)
  740.                         AT: 101DHHHH, D=drive number, HHHH=head number
  741.     :0048               XT: INT 13 subfunction number
  742.                         AT: comand byte to hard disk controller
  743.     :0049               Current video mode
  744.     :004A               Video columns on screen
  745.     :004C               Video page (regen buffer) size in bytes
  746.     :004E               Video current page start address in regen buffer
  747. 19
  748.     :0050               Video cursor position (col, row) for eight pages
  749.     :0060               Video cursor type, hi=startline, lo=endline
  750.     :0062               Video current page number
  751.     :0063               Video CRT controller base address
  752.     :0065               Video current setting of mode select register 
  753.     :0066               Video current setting of CGA palette register 03D9h
  754.     :0067               POST real mode re-entry point after certain resets
  755.                         pointer to reset code upon system reset (PS/2 except 
  756.                         mod 25,30) with memory preserved 
  757.     :006B               POST last unexpected interrupt
  758.     :006C               Timer ticks since midnight
  759.     :0070               Timer overflow
  760.     :0071               Ctrl-Break flag
  761.     :0072               POST reset flag
  762.     :0074               Fixed disk last operation status, except ESDI drives
  763.     :0075               Number of fixed disk drives
  764.     :0076               Fixed disk control byte   
  765.     :0077               Fixed disk I/O port offset 
  766.     :0078               Parallel devices 1-3 time-out counters
  767.     :007B               parallel device 4 time-out counter (non-PS/2 and PS/2 
  768.                         Mod 25,30)
  769.     :007C               Serial devices 1-4 time-out counters
  770.     :0080               Keyboard buffer start as offset from segment 40h 
  771.     :0082               Keyboard buffer end+1 as offset from segment 40h 
  772.     :0084               Video EGA/MCGA/VGA rows on screen minus one
  773.     :0085               Video EGA/MCGA/VGA character height in scan-lines
  774.     :0087               Video EGA/VGA control
  775.     :0088               Video EGA/VGA switches
  776.     :0089               Video MCGA/VGA mode-set option control
  777.     :008A               Video MCGA/VGA index into Display Combination Code 
  778.                         table
  779.     :008B               Diskette media control (not XT)
  780.     :008C               Fixed disk controller status (not XT)
  781.     :008D               Fixed disk controller Error Status (not XT)
  782.     :008E               Fixed disk Interrupt Control (not XT)
  783.     :008F               Diskette controller information (not XT)
  784.     :0090               Diskette drive 0 media state
  785.     :0091               Diskette drive 1 media state
  786.     :0092               Diskette drive 0 media state at start of operation
  787.     :0093               Diskette drive 1 media state at start of operation
  788.     :0094               Diskette drive 0 current track number
  789.     :0095               Diskette drive 1 current track number
  790.     :0096               Keyboard status byte 1
  791.     :0097               Keyboard status byte 2
  792.     :0098               Timer2
  793.     :009C               Timer2
  794.     :00A0               Timer2
  795.     :00A1               LAN Support Program Interrupt Arbitrator present
  796.     :00A2               Reserved for network adapters
  797.     :00A4               Saved Fixed Disk Interrupt Vector (PS/2 Mod 30)
  798.     :00A8               Video: EGA/MCGA/VGA ptr to Video Save Pointer Table 
  799.     :00AC               Reserved
  800.     :00B0               Vendor specific
  801.     :00CE               Count of days since last boot
  802.     :00D0               Reserved
  803.     :00F0               Reserved for user
  804.     :0100               Print Screen Status byte
  805.     :010E               State of BREAK at start of BASICA.COM execution
  806.     :010F               BASICA v2.10 running flag
  807.     :0116               INT 1B at start of BASICA.COM execution
  808. 20
  809.     :011A               INT 24 at start of BASICA.COM execution
  810. 0040:011E               DOS kernel
  811. ????:????               Device drivers
  812. ????:????               Resident part of COMMAND.COM
  813. ????:????               FREE SPACE
  814. A000:0000               EGA/VGA Video RAM
  815. B000:0000               Video RAM
  816. C000:0000               EGA/VGA BIOS ROM extension      ) DOS
  817. C000:8000               Hard drive ROM extension        ) HIGH MEMORY
  818. E000:0000               Other BIOS ROM extensions       ) AREA
  819. F000:0000               BIOS ROM
  820.     :EFC7               Floppy disk parameters
  821.     :F0A4               Video hardware table
  822.     :FEF3               Initial interrupt vector table values
  823.     :FFF5               BIOS version date code
  824.     :FFFE               Model type 
  825.     :FFFF               Model sub type 
  826. 21
  827.                       XT, AT and PS/2  I/O port addresses
  828.  
  829.  
  830. This data is provided for the purpose of providing an understanding into the 
  831. nature of a program being analysed which accesses hardware ports. It is not 
  832. intended to describe how to program the IBM PC hardware ports since this can 
  833. lead to damage of the hardware. Note, although SSD has several safeguards 
  834. inbuilt to prevent programs carrying out harmful port writes, it is not 
  835. possible to catch all and a determined program may still damage your hardware 
  836. even when analysed with SSD. 
  837.  
  838.  
  839. "r" indicates port may be read. "w" indicates port may be written to 
  840. (programmed). "r/w" indicates that the port may be both read and written to. 
  841.  
  842. 0000-001F ----  DMA 1   (first Direct Memory Access controller 8237)
  843.  
  844. 0000    r/w     DMA channel 0 address    byte 0, then byte 1.
  845. 0001    r/w     DMA channel 0 word count byte 0, then byte 1.
  846. 0002    r/w     DMA channel 1 address    byte 0, then byte 1.
  847. 0003    r/w     DMA channel 1 word count byte 0, then byte 1.
  848. 0004    r/w     DMA channel 2 address    byte 0, then byte 1.
  849. 0005    r/w     DMA channel 2 word count byte 0, then byte 1.
  850. 0006    r/w     DMA channel 3 address    byte 0, then byte 1.
  851. 0007    r/w     DMA channel 3 word count byte 0, then byte 1.
  852.  
  853. 0008    r       DMA channel 0-3 status register
  854.                  bit 7 = 1  channel 3 request
  855.                  bit 6 = 1  channel 2 request
  856.                  bit 5 = 1  channel 1 request
  857.                  bit 4 = 1  channel 0 request
  858.                  bit 3 = 1  channel terminal count on channel 3
  859.                  bit 2 = 1  channel terminal count on channel 2
  860.                  bit 1 = 1  channel terminal count on channel 1
  861.                  bit 0 = 1  channel terminal count on channel 0
  862.  
  863. 0008    w       DMA channel 0-3 command register
  864.                  bit 7 = 1  DACK sense active high
  865.                        = 0  DACK sense active low
  866.                  bit 6 = 1  DREQ sense active high
  867.                        = 0  DREQ sense active low
  868.                  bit 5 = 1  extended write selection
  869.                        = 0  late write selection
  870.                  bit 4 = 1  rotating priority
  871.                        = 0  fixed priority
  872.                  bit 3 = 1  compressed timing
  873.                        = 0  normal timing
  874.                  bit 2 = 1  enable controller
  875.                        = 0  enable memory-to-memory
  876.  
  877. 0009    w       DMA write request register
  878.  
  879. 22
  880. 000A    r/w     DMA channel 0-3 mask register
  881.                  bit 7-3 = 0   reserved
  882.                  bit 2   = 0   clear mask bit
  883.                          = 1   set mask bit
  884.                  bit 1-0 = 00  channel 0 select
  885.                          = 01  channel 1 select
  886.                          = 10  channel 2 select
  887.                          = 11  channel 3 select
  888.  
  889. 000B    w       DMA channel 0-3 mode register
  890.                  bit 7-6 = 00  demand mode
  891.                          = 01  single mode
  892.                          = 10  block mode
  893.                          = 11  cascade mode
  894.                  bit 5   = 0   address increment select
  895.                          = 1   address decrement select
  896.                  bit 3-2 = 00  verify operation
  897.                          = 01  write to memory
  898.                          = 10  read from memory
  899.                          = 11  reserved
  900.                  bit 1-0 = 00  channel 0 select
  901.                          = 01  channel 1 select
  902.                          = 10  channel 2 select
  903.                          = 11  channel 3 select
  904.  
  905. 000C    w       DMA clear byte pointer flip-flop
  906. 000D    r       DMA read temporary register
  907. 000D    w       DMA master clear
  908. 000E    w       DMA clear mask register
  909. 000F    w       DMA write mask register
  910.  
  911.  
  912. 0010-001F ----  DMA controller (8237) on PS/2 model 60 & 80
  913.  
  914.  
  915. 0018    w       PS/2 extended function register
  916.  
  917. 001A            PS/2 extended function execute
  918.  
  919.  
  920. 0020-003F ----  PIC 1   (Programmable Interrupt Controller 8259)
  921.  
  922. 0020    w       PIC initialization command word ICW1
  923.                  bit 7-5 = 0  only used in 80/85 mode
  924.                  bit 4   = 1  ICW1 is being issued
  925.                  bit 3   = 0  edge triggered mode
  926.                          = 1  level triggered mode
  927.                  bit 2   = 0  successive interrupt vectors use 8 bytes
  928.                          = 1  successive interrupt vectors use 4 bytes
  929.                  bit 1   = 0  cascade mode
  930.                          = 1  single mode, no ICW3 needed
  931.                  bit 0   = 0  no ICW4 needed
  932.                          = 1  ICW4 needed
  933.  
  934. 0021    w       PIC  ICW2,ICW3,ICW4 after ICW1 to 0020
  935.                 ICW2:
  936.                  bit 7-3 = address lines A0-A3 of base vector address for PIC
  937.                  bit 2-0 = reserved
  938.                 ICW3:
  939.                  bit 7-0 = 0  slave controller not attached to corresponding
  940. 23
  941.                               interrupt pin
  942.                          = 1  slave controller attached to corresponding
  943.                               interrupt pin
  944.                 ICW4:
  945.                  bit 7-5 = 0  reserved
  946.                  bit 4   = 0  no special fully-nested mode
  947.                          = 1  special fully-nested mode
  948.                  bit 3-2 = 0x nonbuffered mode
  949.                          = 10 buffered mode/slave
  950.                          = 11 buffered mode/master
  951.                  bit 1   = 0  normal EOI
  952.                          = 1  Auto EOI
  953.                  bit 0   = 0  8085 mode
  954.                          = 1  8086/8088 mode
  955.  
  956. 0021    r/w     PIC master interrupt mask register
  957.                 OCW1:
  958.                  bit 7 = 0  enable parallel printer interrupt
  959.                  bit 6 = 0  enable diskette interrupt
  960.                  bit 5 = 0  enable fixed disk interrupt
  961.                  bit 4 = 0  enable serial port 1 interrupt
  962.                  bit 3 = 0  enable serial port 2 interrupt
  963.                  bit 2 = 0  enable video interrupt
  964.                  bit 1 = 0  enable keyboard, mouse, RTC interrupt
  965.                  bit 0 = 0  enable timer interrupt
  966.                 OCW2:
  967.                  bit 7-5 = 000  rotate in auto EOI mode (clear)
  968.                          = 001  nonspecific EOI
  969.                          = 010  no operation
  970.                          = 011  specific EOI
  971.                          = 100  rotate in auto EOI mode (set)
  972.                          = 101  rotate on nonspecific EOI command
  973.                          = 110  set priority command
  974.                          = 111  rotate on specific EOI command
  975.                  bit 4   = 0    reserved
  976.                  bit 3   = 0    reserved
  977.                  bit 2-0        interrupt request to which the command applies
  978.  
  979. 0020    r       PIC  interrupt request/in-service registers by OCW3
  980.                 request register:
  981.                  bit 7-0 = 0  no active request for the corresponding int. line
  982.                          = 1  active request for corresponding interrupt line
  983.                 in-service register:
  984.                  bit 7-0 = 0  corresponding line not currently being serviced
  985.                          = 1  corresponding int. line currently being serviced
  986.  
  987. 24
  988. 0020    w       PIC OCW3
  989.                  bit 7   = 0   reserved
  990.                  bit 6-5 = 0x  no operation
  991.                          = 10  reset special mask
  992.                          = 11  set special mask
  993.                  bit 4   = 0   reserved
  994.                  bit 3   = 1   reserved
  995.                  bit 2   = 0   no poll command
  996.                          = 1   poll command
  997.                  bit 1-0 = 0x  no operation
  998.                          = 10  read int.request register on next read at 0020
  999.                          = 11  read int.in-service register on next read 0020
  1000.  
  1001.  
  1002. 0022-002B ----  Intel 82355, part of chipset for 386sx
  1003.                  initialisation in POST will disable these addresses,
  1004.                  only a hard reset will enable them again.
  1005.  
  1006. 0022    r/w     82335 MCR memory configuration register
  1007. 0024            82335 RC1 roll compare register
  1008. 0026            82335 RC2 roll compare register
  1009. 0028            82335 CC0 compare register
  1010. 002A            82335 CC1 compare register
  1011.  
  1012.                   values for CC0 and CC1:
  1013.                   00F9,0000  enable range compare CC0 0-512K  CC1 disable
  1014.                   00F1,0000  enable range compare CC0 0-1024K CC1 disable
  1015.                   00F1,10F9  enable range compare CC0 0-1M    CC1 1M-1M5
  1016.                   00E1,0000  enable range compare CC0 0-2M    CC1 disable
  1017.                   00E1,0000  enable range compare CC0 0-2M    CC1 disable
  1018.                   00C1,0000  enable range compare CC0 0-4M    CC1 disable
  1019.                   00C1,40E1  enable range compare CC0 0-4M    CC1 4M-6M
  1020.                   0081,0000  enable range compare CC0 0-8M    CC1 disable
  1021.  
  1022.  
  1023. 0040-005F ----  PIT  (Programmable Interrupt Timer  8253, 8254)
  1024.                  XT & AT uses 40-43    PS/2 uses 40, 42,43,44, 47
  1025.  
  1026. 0040    r/w     PIT  counter 0, counter divisor       (XT, AT, PS/2)
  1027. 0041    r/w     PIT  counter 1, RAM refresh counter   (XT, AT)
  1028. 0042    r/w     PIT  counter 2, cassette & speaker    (XT, AT, PS/2)
  1029.  
  1030. 25
  1031. 0043    r/w     PIT  mode port, control word register for counters 0-2
  1032.                  bit 7-6 = 00  counter 0 select
  1033.                          = 01  counter 1 select   (not PS/2)
  1034.                          = 10  counter 2 select
  1035.                  bit 5-4 = 00  counter latch command
  1036.                          = 01  read/write counter bits 0-7 only
  1037.                          = 10  read/write counter bits 8-15 only
  1038.                          = 11  read/write counter bits 0-7 first, then 8-15
  1039.                  bit 3-1 = 000 mode 0 select
  1040.                          = 001 mode 1 select - programmable one shot
  1041.                          = x10 mode 2 select - rate generator
  1042.                          = x11 mode 3 select - square wave generator
  1043.                          = 100 mode 4 select - software triggered strobe
  1044.                          = 101 mode 5 select - hardware triggered strobe
  1045.                  bit 0   = 0   binary counter 16 bits
  1046.                          = 1   BCD counter
  1047.  
  1048. 0044    r/w     PIT  counter 3 (PS/2, EISA)
  1049.                 used as fail-safe timer. generates an NMI on time out.
  1050.                 for user generated NMI see at 0462.
  1051.  
  1052. 0047    w       PIT  control word register counter 3 (PS/2, EISA)
  1053.                  bit 7-6 = 00  counter 3 select
  1054.                          = 01  reserved
  1055.                          = 10  reserved
  1056.                          = 11  reserved
  1057.                  bit 5-4 = 00  counter latch command counter 3
  1058.                          = 01  read/write counter bits 0-7 only
  1059.                          = 1x  reserved
  1060.                  bit 3-0 = 00
  1061.  
  1062. 0048            EISA
  1063. 004A            EISA
  1064. 004B            EISA
  1065.  
  1066.  
  1067. 26
  1068. 0060-006F ----  Keyboard controller (8041, 8042)  (or PPI (8255) on XT)
  1069.                  XT uses 60-63,  AT uses 60-64
  1070.  
  1071.                  AT keyboard controller input port bit definitions
  1072.                   bit 7   = 0  keyboard inhibited
  1073.                   bit 6   = 0  CGA, else MDA
  1074.                   bit 5   = 0  manufacturing jumper installed
  1075.                   bit 4   = 0  system RAM 512K, else 640K
  1076.                   bit 3-0      reserved
  1077.  
  1078.                  AT keyboard controller input port bit definitions by Compaq
  1079.                   bit 7   = 0  security lock is locked
  1080.                   bit 6   = 0  Compaq dual-scan display
  1081.                           = 1  non-Compaq display
  1082.                   bit 5   = 0  system board dip switch 5 is ON
  1083.                   bit 4   = 0  auto speed selected 
  1084.                           = 1  high speed selected
  1085.                   bit 3   = 0  slow (4MHz) 
  1086.                           = 1  fast (8MHz)
  1087.                   bit 2   = 0  80287 installed 
  1088.                           = 1  no NDP installed
  1089.                   bit 1-0      reserved
  1090.  
  1091.                  AT keyboard controller output port bit definitions
  1092.                   bit 7 =    keyboard data output
  1093.                   bit 6 =    keyboard clock output
  1094.                   bit 5 = 0  input buffer full
  1095.                   bit 4 = 0  output buffer empty
  1096.                   bit 3 =    reserved (see note)
  1097.                   bit 2 =    reserved (see note)
  1098.                   bit 1 =    gate A20
  1099.                   bit 0 =    system reset
  1100.                 Note:   bits 2 and 3 are the turbo speed switch or password
  1101.                           lock on Award/AMI/Phoenix BIOSes.  These bits make
  1102.                           use of nonstandard keyboard controller BIOS
  1103.                           functionality to manipulate
  1104.                             pin 23 (8041 port 22) as turbo switch for AWARD
  1105.                             pin 35 (8041 port 15) as turbo switch/pw lock for
  1106.                                 Phoenix
  1107.  
  1108. 0060    r/w     KB controller data port or keyboard input buffer (ISA, EISA)
  1109.                 should only be read from after status port bit0 = 1
  1110.                 should only be written to if status port bit1 = 0
  1111.                 keyboard commands (data goes also to port 0060):
  1112.                  ED     dbl   set/reset mode indicators Caps Num Scrl
  1113.                  EE     sngl  diagnostic echo. returns EE.
  1114.                  EF-F2  sngl  NOP (No OPeration). reserved for future use
  1115.                  F3     dbl   set typematic rate/delay
  1116.                  F4     sngl  enable keyboard
  1117.                  F5     sngl  disable keyboard. set default parameters
  1118.                  F6     sngl  set default parameters
  1119.                  F7-FD  sngl  NOP
  1120.                  FE     sngl  resend last scancode
  1121.                  FF     sngl  perform internal power-on reset function
  1122.  
  1123.  
  1124. 0060    r       KeyBoard or KB controller data output buffer (via PPI on XT)
  1125.  
  1126. 0061    w       KB controller port B (ISA, EISA)   (PS/2 port A is at 0092)
  1127.                 system control port for compatibility with 8255
  1128. 27
  1129.                  bit 7  (1= IRQ 0 reset )
  1130.                  bit 6-4    reserved
  1131.                  bit 3 = 1  channel check enable
  1132.                  bit 2 = 1  parity check enable
  1133.                  bit 1 = 1  speaker data enable
  1134.                  bit 0 = 1  timer 2 gate to speaker enable
  1135.  
  1136. 0061    r       KB controller port B control register (ISA, EISA)
  1137.                 system control port for compatibility with 8255
  1138.                  bit 7   parity check occurred
  1139.                  bit 6   channel check occurred
  1140.                  bit 5   mirrors timer 2 output condition
  1141.                  bit 4   toggles with each refresh request
  1142.                  bit 3   channel check status
  1143.                  bit 2   parity check status
  1144.                  bit 1   speaker data status
  1145.                  bit 0   timer 2 gate to speaker status
  1146.  
  1147. 0061    w       PPI  Programmable Peripheral Interface 8255 (XT only)
  1148.                 system control port
  1149.                  bit 7 = 1  clear keyboard
  1150.                  bit 6 = 0  hold keyboard clock low
  1151.                  bit 5 = 0  I/O check enable
  1152.                  bit 4 = 0  RAM parity check enable
  1153.                  bit 3 = 0  read low switches
  1154.                  bit 2      reserved, often used as turbo switch
  1155.                  bit 1 = 1  speaker data enable
  1156.                  bit 0 = 1  timer 2 gate to speaker enable
  1157.  
  1158. 0062    r/w     PPI (XT only)
  1159.                  bit 7 = 1  RAM parity check
  1160.                  bit 6 = 1  I/O channel check
  1161.                  bit 5 = 1  timer 2 channel out
  1162.                  bit 4      reserved 
  1163.                  bit 3 = 1  system board RAM size type 1
  1164.                  bit 2 = 1  system board RAM size type 2
  1165.                  bit 1 = 1  coprocessor installed
  1166.                  bit 0 = 1  loop in POST
  1167.  
  1168. 28
  1169. 0063    r/w     PPI (XT only) command mode register  (read dipswitches)
  1170.                  bit 7-6 = 00  1 diskette drive
  1171.                          = 01  2 diskette drives
  1172.                          = 10  3 diskette drives
  1173.                          = 11  4 diskette drives
  1174.                  bit 5-4 = 00  reserved
  1175.                          = 01  40*25 color (mono mode)
  1176.                          = 10  80*25 color (mono mode)
  1177.                          = 11  MDA 80*25
  1178.                  bit 3-2 = 00  256K (using 256K chips)
  1179.                          = 01  512K (using 256K chips)
  1180.                          = 10  576K (using 256K chips)
  1181.                          = 11  640K (using 256K chips)
  1182.                  bit 3-2 = 00  64K  (using 64K chips)
  1183.                          = 01  128K (using 64K chips)
  1184.                          = 10  192K (using 64K chips)
  1185.                          = 11  256K (using 64K chips)
  1186.                  bit 1-0       reserved
  1187.  
  1188. 0064    r       KB controller read status (ISA, EISA)
  1189.                  bit 7 = 1 parity error on transmission from keyboard
  1190.                  bit 6 = 1 receive timeout
  1191.                  bit 5 = 1 transmit timeout
  1192.                  bit 4 = 0 keyboard inhibit
  1193.                  bit 3 = 1 data in input register is command
  1194.                          0 data in input register is data
  1195.                  bit 2 = 0 system flag status 
  1196.                        = 0 power up or reset 
  1197.                        = 1 selftest OK
  1198.                  bit 1 = 1 input buffer full (input 60/64 has data for 8042)
  1199.                  bit 0 = 1 output buffer full (output 60 has data for system)
  1200.  
  1201. 0064    r        KB controller read status by Compaq
  1202.                  bit 7 = 1 parity error detected (11-bit format only). If an
  1203.                            error is detected, a Resend command is sent to the
  1204.                            keyboard once only, as an attempt to recover.
  1205.                  bit 6 = 1 receive timeout. transmission didn't finish in 2mS.
  1206.                  bit 5 = 1 transmission timeout error
  1207.                             bit 5,6,7  cause
  1208.                                 1 0 0  No clock
  1209.                                 1 1 0  Clock OK, no response
  1210.                                 1 0 1  Clock OK, parity error
  1211.                  bit 4 = 0 security lock engaged
  1212.                  bit 3 = 1 data in OUTPUT register is command
  1213.                          0 data in OUTPUT register is data
  1214.                  bit 2 = 0 system flag status 
  1215.                        = 0 power up or reset 
  1216.                        = 1 soft reset
  1217.                  bit 1 = 1 input buffer full (output 60/64 has data)
  1218.                  bit 0 = 0 no new data in buffer (input 60 has data)
  1219.  
  1220. 29
  1221. 0064    w       KB controller input buffer (ISA, EISA)
  1222.                 KB controller commands (data goes to port 0060):
  1223.                  20     read  read byte zero of internal RAM, this is the
  1224.                               last KB command send to 8041
  1225.                       Compaq  Put current command byte on port 0060
  1226.                                 command structure:
  1227.                                 bit 7   reserved
  1228.                                 bit 6 = 1 convert KB codes to 8086 scan codes
  1229.                                 bit 5 = 0 use 11-bit codes 
  1230.                                       = 1 use 8086 codes
  1231.                                 bit 4 = 0 enable keyboard 
  1232.                                       = 1 disable keyboard
  1233.                                 bit 3 = 1 ignore security lock state
  1234.                                 bit 2     this bit goes into bit2 status reg.
  1235.                                 bit 1 = 0 reserved
  1236.                                 bit 0 = 1 generate int. when output buffer full
  1237.                  21-3F  read  reads the byte specified in the lower 5 bits of
  1238.                               the command in the 8041's internal RAM
  1239.                  60-7F  dbl   writes the data byte to the address specified in
  1240.                               the 5 lower bits of the command.
  1241.  
  1242.                               Alternate description KB IO command 60 summary:
  1243.                                bit7 = 0 reserved
  1244.                                bit6 =   IBM PC compatibility mode
  1245.                                bit5 =   IBM PC mode
  1246.                                bit4 =   disable kb
  1247.                                bit3 =   inhibit override
  1248.                                bit2 =   system flag
  1249.                                bit1 = 0 reserved
  1250.                                bit0 =   enableoutput buffer full interrupt
  1251.  
  1252.                  60   Compaq  Load new command (60 to [64], command to [60])
  1253.                  A1   Compaq  unknown speedfunction 
  1254.                  A2   Compaq  unknown speedfunction 
  1255.                  A3   Compaq  Enable system speed control
  1256.                  A4   Compaq  Toggle speed
  1257.                  A5   Compaq  Special reed. the 8042 places the real values
  1258.                               of port 2 except for bits 4 and 5 wich are given
  1259.                               a new definition in the output buffer. No output
  1260.                               buffer full is generated.
  1261.                                 if bit 5 = 0, a 9-bit keyboard is in use
  1262.                                 if bit 5 = 1, an 11-bit keyboard is in use
  1263.                                 if bit 4 = 0, outp-buff-full interrupt disabled
  1264.                                 if bit 4 = 1, output-buffer-full int. enabled
  1265.                  A6   Compaq  unknown speedfunction 
  1266.                  AA     sngl  initiate self-test. will return 55 to data port
  1267.                       Compaq  Initializes ports 1 and 2, disables the keyboard
  1268.                               and clears the buffer pointers. It then places
  1269.                               55 in the output buffer.
  1270.                  AB     sngl  initiate interface test. result values:
  1271.                                0 = no error
  1272.                                1 = keyboard clock line stuck low
  1273.                                2 = keyboard clock line stuck high
  1274.                                3 = keyboard data line is stuck low
  1275.                                4 = keyboard data line stuck high
  1276.                       Compaq   5 = Compaq diagnostic feature
  1277.                  AC     read  diagnostic dump. the contents of the 8041 RAM,
  1278.                               output port, input port, status word are send.
  1279.                  AD     sngl  disable keyboard (sets bit 4 of commmand byte)
  1280.                  AE     sngl  enable keyboard  (resets bit 4 of commmand byte)
  1281. 30
  1282.                  AF     AWARD Enhanced Command: read keyboard version
  1283.                  C0     read  read input port
  1284.                       Compaq  Places status of input port in output buffer. use
  1285.                               this command only when the output buffer is empty
  1286.                  C1     AWARD Enhanced Command: poll input port Low nibble
  1287.                  C2     AWARD Enhanced Command: poll input port High nibble
  1288.                  D0     read  read output port
  1289.                       Compaq  Places byte in output port in output buffer. use
  1290.                               this command only when the output buffer is empty
  1291.                  D1     dbl   write output port. next byte written  to 0060
  1292.                               will be written to the 8041 output port
  1293.                       Compaq  The system speed bits are not set by this command
  1294.                               use commands A1-A6 (!) for speed functions.
  1295.                  D2     AWARD Enhanced Command: write keyboard output buffer
  1296.                  D3     AWARD Enhanced Command: write pointing device out.buf.
  1297.                  D4     AWARD Enhanced Command: write to auxiliary device
  1298.                  DD     sngl  disable address line A20. default in Real Mode
  1299.                  DF     sngl  enable address line A20
  1300.                  E0     read  read test inputs. bit0 = T0 and bit1 = T1
  1301.                  Exx    AWARD Enhanced Command: active output port
  1302.                  ED   Compaq  This is a two part command to control the state
  1303.                               of the NumLock CpasLock and ScrollLock LEDs
  1304.                               The second byte contains the state to set LEDs.
  1305.                                 bit 7-3    reserved. should be set to 0.
  1306.                                 bit 2 = 0  Caps Lock LED off
  1307.                                 bit 1 = 0  Num Lock LED off
  1308.                                 bit 0 = 0  Scroll Lock LED off
  1309.                  F0-FF  sngl  pulse output port low for 6 microseconds.
  1310.                               bits 0-3 contain the mask for the bits to be
  1311.                               pulsed. a bit is pulsed if its mask bit is zero.
  1312.                               bit0=system reset. Don't set to zero. Pulse only!
  1313.  
  1314. 0065    r       communications port (Olivetti M24)
  1315.  
  1316. 0068    w       HP-Vectra  control buffer (HP commands)
  1317. 0069    r       HP-Vectra  SVC (keyboard request SerViCe port)
  1318. 006A    w       HP-Vectra  clear processing, done
  1319.  
  1320. 006C-006F       HP-HIL  (Human Interface Link = async. serial inputs 0-7)
  1321.  
  1322.  
  1323. 0070-007F ----  CMOS RAM/RTC (Real Time Clock  MC146818)
  1324.  
  1325. 31
  1326. 0070    w       CMOS RAM index register port (ISA, EISA)
  1327.                  bit 7   = 1  NMI disabled
  1328.                          = 0  NMI enabled
  1329.                  bit 6-0      CMOS RAM index (64 bytes, sometimes 128 bytes)
  1330.  
  1331.                 any write to 0070 should be followed by an action to 0071
  1332.                 or the RTC wil be left in an unknown state.
  1333.  
  1334. 0071    r/w     CMOS RAM data port (ISA, EISA)
  1335.                 RTC registers:
  1336.                 00    current second in BCD
  1337.                 01    alarm second   in BCD
  1338.                 02    current minute in BCD
  1339.                 03    alarm minute   in BCD
  1340.                 04    current hour in BCD
  1341.                 05    alarm hour   in BCD
  1342.                 06    day of week  in BCD
  1343.                 07    day of month in BCD
  1344.                 08    month in BCD
  1345.                 09    year  in BCD (00-99)
  1346.                 0A    status register A
  1347.                        bit 7 = 1  update in progress
  1348.                        bit 6-4 divider that identifies the time-based
  1349.                                 frequency
  1350.                        bit 3-0 rate selection output  frequency and int. rate
  1351.                 0B    status register B
  1352.                        bit 7 = 0  run
  1353.                              = 1  halt
  1354.                        bit 6 = 1  enable periodic interrupt
  1355.                        bit 5 = 1  enable alarm interrupt
  1356.                        bit 4 = 1  enable update-ended interrupt
  1357.                        bit 3 = 1  enable square wave interrupt
  1358.                        bit 2 = 1  calendar is in binary format
  1359.                              = 0  calendar is in BCD format
  1360.                        bit 1 = 1  24-hour mode
  1361.                              = 0  12-hour mode
  1362.                        bit 0 = 1  enable daylight savings time. only in USA.
  1363.                                   useless in Europe. Some DOS versions clear
  1364.                                   this bit when you use the DAT/TIME command.
  1365.                 0C    status register C
  1366.                        bit 7 =    interrupt request flag
  1367.                        bit 6 =    peridoc interrupt flag
  1368.                        bit 5 =    alarm interrupt flag
  1369.                        bit 4 =    update interrupt flag
  1370.                        bit 3-0    reserved
  1371.                 0D    status register D
  1372.                        bit 7 = 1  Real-Time Clock has power
  1373.                        bit 6-0    reserved
  1374.                 0E    diagnostics status byte
  1375.                        bit 7 = 0  RTC lost power
  1376.                        bit 6 = 1  CMOS RAM checksum bad
  1377.                        bit 5 = 1  invalid configuration information at POST
  1378.                        bit 4 = 1  memory size error at POST
  1379.                        bit 3 = 1  fixed disk/adapter failed initialization
  1380.                        bit 2 = 1  CMOS RAM time found invalid
  1381.                        bit 1 = 1  adapters do not match configuration (EISA)
  1382.                        bit 0 = 1  time out reading an adapter ID (EISA)
  1383.                 0F    shutdown status byte
  1384.                        00 = normal execution of POST
  1385.                        01 = chip set initialization for real mode reentry
  1386. 32
  1387.                        04 = jump to bootstrap code
  1388.                        05 = issue an EOI an JMP to Dword ptr at 40:67
  1389.                        06 = JMP to Dword ptrv at 40:67 without EOI
  1390.                        07 = return to INT15/87 (block move)
  1391.                        08 = return to POST memory test
  1392.                        09 = return to INT15/87 (block move)
  1393.                        0A = JMP to Dword ptr at 40:67 without EOI
  1394.                        0B = return IRETS through 40:67
  1395.                 10    diskette drive type for A: and B:
  1396.                        bit 7-4  drive type of drive 0
  1397.                        bit 3-0  drive type of drive 1
  1398.                                = 0000      no drive
  1399.                                = 0001      360K
  1400.                                = 0010      1M2
  1401.                                = 0011      720K
  1402.                                = 0100      1M44
  1403.                                = 0101-1111 reserved
  1404.                 11    reserved / AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1405.                        bit 7   = 1     Typematic Rate Programming
  1406.                        bit 6-5 = 00    Typematic Rate Delay 250 mSec
  1407.                        bit 4-0 = 00011 Typematic Rate 21.8 Chars/Sec
  1408.                 12    fixed disk drive type for drive 0 and drive 1
  1409.                        bit 7-4  drive type of drive 0
  1410.                        bit 3-0  drive type of drive 1
  1411.                                 if either of the nibbles equals 0F, then bytes
  1412.                                 19 an 1A are valid
  1413.                 13    reserved / AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1414.                        bit 7 = 1  Mouse Support Option
  1415.                        bit 6 = 1  Above 1 MB Memory Test disable
  1416.                        bit 5 = 1  Memory Test Tick Sound disable
  1417.                        bit 4 = 1  Memory Parity Error Check enable
  1418.                        bit 3 = 1  Hit <ESC> Message Display disabled
  1419.                        bit 2 = 1  Hard Disk Type 47 Data Area at address 0:300
  1420.                        bit 1 = 1  Wait For <F1> If Any Error enabled
  1421.                        bit 0 = 1  System Boot Up Num Lock is On
  1422.                 14    equipment byte
  1423.                        bit 7-6   diskette drives installed
  1424.                                = 00  1 drive installed
  1425.                                = 01  2 drives installed
  1426.                                = 10  reserved
  1427.                                = 11  reserved
  1428.                        bit 5-4   primary display
  1429.                                = 00  adapter card with option ROM 
  1430.                                = 01  40*25 color
  1431.                                = 10  80*25 color
  1432.                                = 11  monochrome
  1433.                        bit 3-2   reserved
  1434.                        bit 1   = 1  coprocessor installed (non-Weitek)
  1435.                        bit 0        diskette drive avaliable for boot
  1436.                 15    LSB of systemn base memory in Kb
  1437.                 16    MSB of systemn base memory in Kb
  1438.                 17    LSB of total extended memory in Kb
  1439.                 18    MSB of total extended memory in Kb
  1440.                 19    drive C extension byte
  1441.                 1A    drive D extension byte
  1442.                 1B-27 reserved
  1443.                 1B/1C word to 82335 RC1 roll compare register at [24]
  1444.                       (Phoenix)
  1445.                 1D/1E word to 82335 RC2 roll compare register at [26]
  1446.                       (Phoenix)
  1447. 33
  1448.                 28    HP-Vectra checksum over 29-2D
  1449.                 29-2D reserved
  1450.                 29/2A word to Intel 82335 CC0 compare register at [28]
  1451.                       (Phoenix)
  1452.                 2B/2C word send to 82335 CC1 compare register at [2A]
  1453.                       (Phoenix)
  1454.                 2D    AMI Extended CMOS setup (AMI Hi-Flex BIOS)
  1455.                       (Phoenix BIOS checks for the values AA or CC)
  1456.                        bit 7 = 1  Weitek Processor Absent
  1457.                        bit 6 = 1  Floppy Drive Seek At Boot disabled
  1458.                        bit 5 = 1  System Boot Up Sequence  C:, A:
  1459.                        bit 4 = 1  System Boot Up Speed is high
  1460.                        bit 3 = 1  Cache Memory enabled
  1461.                        bit 2 = 1  Internal Cache Memory  <1>
  1462.                        bit 1-0    reserved
  1463.                 2E    CMOS MSB checksum over 10-2D
  1464.                 2F    CMOS LSB checksum over 10-2D
  1465.                 30    LSB of extended memory found above 1Mb at POST
  1466.                 31    MSB of extended memory found above 1Mb at POST
  1467.                 32    date century in BCD
  1468.                 33    information flags
  1469.                        bit4 = bit4 from CPU register CR0   (Phoenix)
  1470.                               this bit is only known as INTEL RESERVED
  1471.                 34-3F reserved  
  1472.                 34     bit4 bit5 (Phoenix BIOS)
  1473.                 3D/3E word to 82335 MCR memory config register at [22]
  1474.                       (Phoenix)
  1475.                 3D     bit3      base memsize 512/640  (Phoenix)
  1476.                 3E     bit7 = 1  relocate enable       (Phoenix)
  1477.                        bit1 = 1  shadow video enable   (Phoenix)
  1478.                        bit0 = 1  shadow BIOS enable    (Phoenix)
  1479.  
  1480.  
  1481.                 User Definable Drive Parameters are also stored in CMOS RAM:
  1482.  
  1483.                 AMI (386sx BIOS 1989) first user definable drive (type 47)
  1484.                  1B  L cylinders
  1485.                  1C  H cylinders
  1486.                  1D  heads
  1487.                  1E  L Write Precompensation Cylinder
  1488.                  1F  H Write Precompensation Cylinder
  1489.                  20  ??
  1490.                  21  L cylinders parking zone
  1491.                  22  H cylinders parking zone
  1492.                  23  sectors
  1493.  
  1494.                 AMI (386sx BIOS 1989) second user definable drive (type 48)
  1495.                  24  L cylinders
  1496.                  25  H cylinders
  1497.                  26  heads
  1498.                  27  L Write Precompensation Cylinder
  1499.                  28  H Write Precompensation Cylinder
  1500.                  29  ??
  1501.                  2A  L cylinders parking zone
  1502.                  2B  H cylinders parking zone
  1503.                  2C  sectors
  1504.  
  1505.                 Phoenix (386BIOS v1.10.03 1988) 1st user definable drv (type48)
  1506.                  20  L cylinders
  1507.                  21  H cylinders
  1508. 34
  1509.                  22  heads
  1510.                  23  L Write Precompensation Cylinder
  1511.                  24  H Write Precompensation Cylinder
  1512.                  25  L cylinders parking zone
  1513.                  26  H cylinders parking zone
  1514.                  27  sectors
  1515.  
  1516.                 Phoenix (386BIOS v1.10.03 1988) 2nd user definable drv (type49)
  1517.                 (when PS/2-style password option is not used)
  1518.                  35  L cylinders
  1519.                  36  H cylinders
  1520.                  37  heads
  1521.                  38  L Write Precompensation Cylinder
  1522.                  39  H Write Precompensation Cylinder
  1523.                  3A  L cylinders parking zone
  1524.                  3B  H cylinders parking zone
  1525.                  3C  sectors
  1526.  
  1527. 0078            HP-Vectra  Hard Reset: NMI enable/disable
  1528.                  bit 7 = 0  disable & clear hard reset from HP-HIL controller
  1529.                        = 1  enable hard reset from HP-HIL controller chip
  1530.                  bit 6-0    reserved
  1531.  
  1532.  
  1533. 007C-007D ----  HP-Vectra  PIC 3   (Programmable Interrupt Controller 8259)
  1534.                 cascaded to first controller.
  1535.                 used for keyboard and input device interface.
  1536. 007C    r/w     HP-Vectra  PIC 3  see at 0020  PIC 1
  1537. 007D    r/w     HP-Vectra  PIC 3  see at 0021  PIC 1
  1538.  
  1539.  
  1540. 0080    w       Manufacturing Diagnostics port
  1541.  
  1542.  
  1543. 35
  1544. 0080-008F ----  DMA page registers   (74612)
  1545.  
  1546. 0080    r/w     extra page register (temporary storage)
  1547. 0081    r/w     DMA channel 2 address byte 2
  1548. 0082    r/w     DMA channel 3 address byte 2
  1549. 0083    r/w     DMA channel 1 address byte 2
  1550. 0084    r/w     extra page register
  1551. 0085    r/w     extra page register
  1552. 0086    r/w     extra page register
  1553. 0087    r/w     DMA channel 0 address byte 2
  1554. 0088    r/w     extra page register
  1555. 0089    r/w     DMA channel 6 address byte 2
  1556. 0089    r/w     DMA channel 7 address byte 2
  1557. 0089    r/w     DMA channel 5 address byte 2
  1558. 008C    r/w     extra page register
  1559. 008D    r/w     extra page register
  1560. 008E    r/w     extra page register
  1561. 008F    r/w     DMA refresh page register
  1562.  
  1563.  
  1564. 0090-009F ----  PS/2 POS (Programmable Option Select)
  1565.  
  1566. 0090            Central arbitration control port
  1567. 0091            Card selection feedback
  1568.  
  1569. 0092    r/w     PS/2 system control port A  (port B is at 0061)
  1570.                  bit 7-6   any bit set to 1 turns activity light on
  1571.                  bit 5     reserved
  1572.                  bit 4 = 1 watchdog timout occurred 
  1573.                  bit 3 = 0 RTC/CMOS security lock (on password area) unlocked
  1574.                        = 1 CMOS locked (done by POST)
  1575.                  bit 2     reserved
  1576.                  bit 1 = 1 indicates A20 active
  1577.                  bit 0 = 0 system reset or write
  1578.                          1 pulse alternate reset pin (alternate CPU reset)
  1579.  
  1580. 0094    w       system board enable/setup register
  1581.                  bit 7 = 1  enable functions
  1582.                        = 0  setup functions
  1583.                  bit 5 = 1  enables VGA
  1584.                        = 0  setup VGA
  1585.  
  1586. 0095            reserved
  1587.  
  1588. 0096    w       adapter enable /setup register
  1589.                  bit 3 = 1  setup adapters
  1590.                        = 0  enable registers
  1591.  
  1592. 0097            reserved
  1593.  
  1594.  
  1595. 36
  1596. 00A0-00AF ----  PIC 2   (Programmable Interrupt Controller 8259)
  1597.  
  1598. 00A0    r/w     NMI mask register (XT)
  1599.  
  1600. 00A0    r/w     PIC 2  same as 0020 for PIC 1
  1601. 00A1    r/w     PIC 2  same as 0021 for PIC 1 except for OCW1:
  1602.                  bit 7 = 0  reserved
  1603.                  bit 6 = 0  enable fixed disk interrupt
  1604.                  bit 5 = 0  enable coprocessor exception interrupt
  1605.                  bit 4 = 0  enable mouse interrupt
  1606.                  bit 3 = 0  reserved
  1607.                  bit 2 = 0  reserved
  1608.                  bit 1 = 0  enable redirect cascade
  1609.                  bit 0 = 0  enable real-time clock interrupt
  1610.  
  1611.  
  1612. 00C0      ----  TI  SN746496 programmable tone/noise generator  PCjr
  1613.  
  1614.  
  1615. 00C0-00DF ----  DMA 2   (second Direct Memory Access controller 8237)
  1616.  
  1617. 00C0    r/w     DMA channel 4 memory address bytes 1 and 0 (low) (ISA, EISA)
  1618. 00C2    r/w     DMA channel 4 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1619. 00C4    r/w     DMA channel 5 memory address bytes 1 and 0 (low) (ISA, EISA)
  1620. 00C6    r/w     DMA channel 5 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1621. 00C8    r/w     DMA channel 6 memory address bytes 1 and 0 (low) (ISA, EISA)
  1622. 00CA    r/w     DMA channel 6 transfer count bytes 1 and 0 (low) (ISA, EISA)
  1623. 00CC    r/w     DMA channel 7 memory address byte 0 (low), then 1 (ISA, EISA)
  1624. 00CE    r/w     DMA channel 7 transfer count byte 0 (low), then 1 (ISA, EISA)
  1625.  
  1626. 00D0    r       DMA channel 4-7 status register (ISA, EISA)
  1627.                  bit 7 = 1  channel 7 request
  1628.                  bit 6 = 1  channel 6 request
  1629.                  bit 5 = 1  channel 5 request
  1630.                  bit 4 = 1  channel 4 request
  1631.                  bit 3 = 1  terminal count on channel 7
  1632.                  bit 2 = 1  terminal count on channel 6
  1633.                  bit 1 = 1  terminal count on channel 5
  1634.                  bit 0 = 1  terminal count on channel 4
  1635.  
  1636. 00D0    w       DMA channel 4-7 command register (ISA, EISA)
  1637.                  bit 7 = 1  DACK sense active high
  1638.                        = 0  DACK sense active low
  1639.                  bit 6 = 1  DREQ sense active high
  1640.                        = 0  DREQ sense active low
  1641.                  bit 5 = 1  extended write selection
  1642.                        = 0  late write selection
  1643.                  bit 4 = 1  rotating priority
  1644.                        = 0  fixed priority
  1645.                  bit 3 = 1  compressed timing
  1646.                        = 0  normal timing
  1647.                  bit 2 = 0  enable controller
  1648.                  bit 1 = 1  enable memory-to-memory transfer
  1649.                  bit 0      .....
  1650.  
  1651. 00D2    w       DMA channel 4-7 write request register (ISA, EISA)
  1652.  
  1653. 00D4    w       DMA channel 4-7 write single mask register (ISA, EISA)
  1654.                  bit 7-3      reserved
  1655.                  bit 2   = 0  clear mask bit
  1656. 37
  1657.                          = 1  set mask bit
  1658.                  bit 1-0 = 00 channel 4 select
  1659.                          = 01 channel 5 select
  1660.                          = 10 channel 6 select
  1661.                          = 11 channel 7 select
  1662.  
  1663. 00D6    w       DMA channel 4-7 mode register (ISA, EISA)
  1664.                  bit 7-6 = 00  demand mode
  1665.                          = 01  single mode
  1666.                          = 10  block mode
  1667.                          = 11  cascade mode
  1668.                  bit 5   = 0   address increment select
  1669.                          = 1   address decrement select
  1670.                  bit 4   = 0   autoinitialisation disable
  1671.                          = 1   autoinitialisation enable
  1672.                  bit 3-2 = 00  verify operation
  1673.                          = 01  write to memory
  1674.                          = 10  read from memory
  1675.                          = 11  reserved
  1676.                  bit 1-0 = 00  channel 4 select
  1677.                          = 01  channel 5 select
  1678.                          = 10  channel 6 select
  1679.                          = 11  channel 7 select
  1680.  
  1681. 00D8    w       DMA channel 4-7 clear byte pointer flip-flop (ISA, EISA)
  1682. 00DA    r       DMA channel 4-7 read temporary register (ISA, EISA)
  1683. 00DA    w       DMA channel 4-7 master clear (ISA, EISA)
  1684. 00DC    w       DMA channel 4-7 clear mask register (ISA, EISA)
  1685. 00DE    w       DMA channel 4-7 write mask register (ISA, EISA)
  1686.  
  1687. 00E0            split address register, memory encoding registers PS/2m80 only
  1688.  
  1689.  
  1690. 00F0-00F5 ----  PCjr Disk Controller
  1691.  
  1692. 00F0            disk controller
  1693. 00F2            disk controller control port
  1694. 00F4            disk controller status register
  1695. 00F5            disk controller data port
  1696.  
  1697.  
  1698. 00F0-00FF ----  coprocessor (8087..80387)
  1699.  
  1700. 00F0            math coprocessor clear busy latch
  1701. 00F1            math coprocessor reset
  1702. 00F8-00FF       math coprocessor
  1703.  
  1704.  
  1705. 0100-010F ----  CompaQ Tape drive adapter. alternate address at 0300
  1706.  
  1707.  
  1708. 0100-0107 ----  PS/2 POS (Programmable Option Select)
  1709.  
  1710. 0100    r       POS register 0  Low adapter ID byte
  1711. 0101    r       POS register 1  High adapter ID byte
  1712.  
  1713. 0102    r/w     POS register 2  option select data byte 1
  1714.                  bit 0 is card enable (CDEN)
  1715.  
  1716. 0103    r/w     POS register 3  option select data byte 2
  1717. 38
  1718. 0104    r/w     POS register 4  option select data byte 3
  1719. 0105    r/w     POS register 5  option select data byte 4
  1720.                  bit 7  channel active (-CHCK)
  1721.                  bit 6  channel status
  1722.  
  1723. 0106    r/w     POS register 6  Low subaddress extension
  1724. 0107    r/w     POS register 7  High subaddress extension
  1725.  
  1726.  
  1727. 0108-010F ----  8 digit LED info panel on IBM PS/2
  1728.  
  1729. 010F    w       leftmost character on display
  1730. 010E    w       second character
  1731. ....    w
  1732. 0108    w       eighth character
  1733.  
  1734.  
  1735. 0130-013F ----  CompaQ SCSI adapter. alternate address at 0330
  1736.  
  1737.  
  1738. 0130-0133 ----  Adaptec 154xB/154xC SCSI adapter.
  1739.                 alternate address at 0134, 0230, 0234 ,0330 and 0334
  1740.  
  1741.  
  1742. 0134-0137 ----  Adaptec 154xB/154xC SCSI adapter.
  1743.                 alternate address at 0130, 0230, 0234 ,0330 and 0334
  1744.  
  1745.  
  1746. 0140-014F ----  SCSI (alternate Small Computer System Interface) adapter
  1747.                 (1st at 0340-034F)
  1748.  
  1749.  
  1750. 0140-0157 ----  RTC (alternate Real Time Clock for XT)   (1st at 0340-0357)
  1751.  
  1752.  
  1753. 0170-0177 ----  HDC 2   (2nd Fixed Disk Controller)   same as 01Fx (ISA, EISA)
  1754.  
  1755.  
  1756. 01E8-01EF ----  System Control. Laptop chipset: Headland HL21 & Acer M5105
  1757.  
  1758. 01ED    r/w     select internal register. Data to/from 01EF
  1759. 01EE    r
  1760. 01EF    r/w     reg.
  1761.                 5  = 1000xxxx  for low CPU clock speed (4MHz on Morse/Mitac)
  1762.                    = 0xxxxxxx  for high CPU clock speed (16MHz on Morse/Mitac)
  1763.  
  1764.  
  1765. 01F0-01F7 ----  HDC 1   (1st Fixed Disk Controller)   same as 017x (ISA, EISA)
  1766.  
  1767. 01F0    r/w     data register
  1768.  
  1769. 01F1    r       error register
  1770.                 diagnostic mode errors:
  1771.                  bit 7-3        reserved
  1772.                  bit 2-1 = 001  no error detected
  1773.                          = 010  formatter device error
  1774.                          = 011  sector buffer error
  1775.                          = 100  ECC circuitry error
  1776.                          = 101  controlling microprocessor error
  1777.                  operation mode:
  1778. 39
  1779.                   bit 7  = 1  bad block detected
  1780.                          = 0  block OK
  1781.                   bit 6  = 1  uncorrectable ECC error
  1782.                          = 0  no error
  1783.                   bit 5       reserved
  1784.                   bit 4  = 1  ID found
  1785.                          = 0  ID not found
  1786.                   bit 3       reserved
  1787.                   bit 2  = 1  command completed
  1788.                          = 0  command aborted
  1789.                   bit 1  = 1  track 000 not found
  1790.                          = 0  track 000 found
  1791.                   bit 0  = 1  DAM not found
  1792.                          = 0  DAM found (CP-3022 always 0)
  1793.  
  1794. 01F1    w       WPC/4  (Write Precompensation Cylinder divided by 4)
  1795.  
  1796. 01F2    r/w     sector count
  1797. 01F3    r/w     sector number
  1798. 01F4    r/w     cylinder low
  1799. 01F5    r/w     cylinder high
  1800.  
  1801. 01F6    r/w     drive/head
  1802.                  bit 7   = 1
  1803.                  bit 6   = 0
  1804.                  bit 5   = 1
  1805.                  bit 4   = 0  drive 0 select
  1806.                          = 1  drive 1 select
  1807.                  bit 3-0      head select bits
  1808.  
  1809. 01F7    r       status register
  1810.                  bit 7 = 1  controller is executing a command
  1811.                  bit 6 = 1  drive is ready
  1812.                  bit 5 = 1  write fault
  1813.                  bit 4 = 1  seek complete
  1814.                  bit 3 = 1  sector buffer requires servicing
  1815.                  bit 2 = 1  disk data read successfully corrected
  1816.                  bit 1 = 1  index - set to 1 each disk revolution
  1817.                  bit 0 = 1  previous command ended in an error
  1818.  
  1819. 40
  1820. 01F7    w       command register
  1821.                 commands:
  1822.                  98 E5   check power mode       (IDE)
  1823.                  90      execute drive diagnostics
  1824.                  50      format track
  1825.                  EC      identify drive         (IDE)
  1826.                  97 E3   idle                   (IDE)
  1827.                  95 E1   idle immediatete       (IDE)
  1828.                  91      initialize drive parameters
  1829.                  1x      recalibrate
  1830.                  E4      read buffer            (IDE)
  1831.                  C8      read DMA with retry    (IDE)
  1832.                  C9      read DMA without retry (IDE)
  1833.                  C4      read multiplec         (IDE)
  1834.                  20      read sectors with retry
  1835.                  21      read sectors without retry
  1836.                  22      read long with retry
  1837.                  23      read long without retry
  1838.                  40      read verify sectors with retry
  1839.                  41      read verify sectors without retry
  1840.                  7x      seek
  1841.                  EF      set features           (IDE)
  1842.                  C6      set multiple mode      (IDE)
  1843.                  99 E6   set sleep mode         (IDE)
  1844.                  96 E2   standby                (IDE)
  1845.                  94 E0   standby immediate      (IDE)
  1846.                  E8      write buffer           (IDE)
  1847.                  CA      write DMA with retry   (IDE)
  1848.                  CB      write DMA with retry   (IDE)
  1849.                  C5      write multiple         (IDE)
  1850.                  E9      write same             (IDE)
  1851.                  30      write sectors with retry
  1852.                  31      write sectors without retry
  1853.                  32      write long with retry
  1854.                  33      write long without retry
  1855.                  3C      write verify           (IDE)
  1856.                  9A      vendor unique          (IDE)
  1857.                  C0-C3   vendor unique          (IDE)
  1858.                  8x      vendor unique          (IDE)
  1859.                  F0-F4   EATA standard          (IDE)
  1860.                  F5-FF   vendor unique          (IDE)
  1861.  
  1862.  
  1863. 41
  1864. 0200-020F ----  Game port reserved I/O address space  
  1865. 0200-0207 ----  Game port, eight identical addresses on some boards
  1866.  
  1867. 0201    r       read joystick position and status
  1868.                  bit 7  status B joystick button 2 / D paddle button
  1869.                  bit 6  status B joystick button 1 / C paddle button
  1870.                  bit 5  status A joystick button 2 / B paddle button
  1871.                  bit 4  status A joystick button 1 / A paddle button
  1872.                  bit 3  B joystick Y coordinate    / D paddle coordinate
  1873.                  bit 2  B joystick X coordinate    / C paddle coordinate
  1874.                  bit 1  A joystick Y coordinate    / B paddle coordinate
  1875.                  bit 0  A joystick X coordinate    / A paddle coordinate
  1876.  
  1877.         w       fire joysticks four one-shots
  1878.  
  1879.  
  1880. 0210-0217 ----  Expansion unit (XT)
  1881.  
  1882. 0210    w       latch expansion bus data
  1883.         r       verify expansion bus data
  1884. 0211    w       clear wait, test latch
  1885.         r       High byte data address
  1886. 0212    r       Low byte data address
  1887. 0213    w       0=enable,  1=disable expansion unit
  1888. 0214    w       latch data  (receiver card port)
  1889.         r       read data   (receiver card port)
  1890. 0215    r       High byte of address, then Low byte   (receiver card port)
  1891.  
  1892.  
  1893. 0220-0227 ----  Soundblaster PRO and SSB 16 ASP
  1894.  
  1895.  
  1896. 0220-022F ----  Soundblaster PRO 2.0
  1897.  
  1898.  
  1899. 0220-022F ----  Soundblaster PRO 4.0
  1900. 0220    r       left FM status port
  1901. 0220    w       left FM music register address port (index)
  1902. 0221    r/w     left FM music data port
  1903. 0222    r       right FM status port
  1904. 0222    w       right FM music register address port (index)
  1905. 0223    r/w     right FM music data port
  1906. 0224    w       mixer register address port (index)
  1907. 0225    r/w     mixer data port
  1908. 0226    w       DSP reset
  1909. 0228    r       FM music status port
  1910. 0228    w       FM music register address port (index)
  1911. 0229    w       FM music data port
  1912. 022A    r       DSP read data (voice I/O and Midi)
  1913. 022C    w       DSP write data / write command
  1914. 022C    r       DSP write buffer status (bit 7)
  1915. 022E    r       DSP data available status (bit 7)
  1916.  
  1917.                 The FM music is accessible on 0388/0389 for compatibility.
  1918.  
  1919.  
  1920. 0230-0233 ----  Adaptec 154xB/154xC SCSI adapter.
  1921.                 alternate address at 0130, 0134, 0230, 0330 and 0334
  1922.  
  1923.  
  1924. 42
  1925. 0234-0237 ----  Adaptec 154xB/154xC SCSI adapter.
  1926.                 alternate address at 0130, 0134, 0230 ,0330 and 0334
  1927.  
  1928.  
  1929. 0240-0257 ----  RTC (alternate Real Time Clock for XT)   (1st at 0340-0357)
  1930.                 (used by TIMER.COM v1.2 which is the 'standard' timer program)
  1931.  
  1932.  
  1933. 0258-025F ----  Intel Above Board
  1934.  
  1935.  
  1936. 0278-027E ----  parallel printer port, same as 0378 and 03BC
  1937.  
  1938. 0278    w       data port
  1939. 0279    r/w     status port
  1940. 027A    r/w     control port
  1941.  
  1942.  
  1943. 02A2-02A3 ----  MSM58321RS clock
  1944.  
  1945.  
  1946. 02B0-02BF ----  Trantor SCSI adapter
  1947.  
  1948.  
  1949. 02B0-02DF ----  alternate EGA,  primary EGA at 03C0
  1950.  
  1951.  
  1952. 02C0-02Cx ----  AST-clock
  1953.  
  1954.  
  1955. 02E0-02EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  1956.                 (GAB 0 on XT)
  1957. 02E1            GPIB (adapter 0)
  1958. 02E2
  1959. 02E3
  1960.  
  1961.  
  1962. 02E0-02EF ----  data aquisition  (AT)
  1963.  
  1964. 02E2            data aquisition (adapter 0)
  1965. 02E3            data aquisition (adapter 0)
  1966.  
  1967.  
  1968. 02E8-02EF ----  serial port, same as 02F8, 03E8, and 03F8
  1969.  
  1970.  
  1971. 43
  1972. 02F8-02FF ----  serial port, same as 02E8, 02F8, and 03F8
  1973.  
  1974. 02F8    w       transmitter holding register
  1975. 02F8    r       receiver buffer register
  1976.         r/w     divisor latch, low byte   when DLAB=1
  1977. 02F9    r/w     divisor latch, high byte  when DLAB=1
  1978.         r/w     interrupt enable register when DLAB=0
  1979. 02FA    r       interrupt identification register
  1980. 02FB    r/w     line control register
  1981. 02FC    r/w     modem control register
  1982. 02FD    r       line status register
  1983. 02FF    r/w     scratch register
  1984.  
  1985.  
  1986. 0300-0301 ---- Soundblaster 16 ASP MPU-Midi
  1987.  
  1988.  
  1989. 0300-031F ----  prototype cards
  1990.                 Periscope hardware debugger
  1991.  
  1992.  
  1993. 0300-030F ----  Philips CD-ROM player CM50
  1994. 0310-031F ----  Philips CD-ROM player CM50
  1995.  
  1996.  
  1997. 0320-0323 ----  XT HDC 1   (Hard Disk Controller)
  1998.  
  1999. 0320    r/w     data register
  2000.  
  2001. 0321    w       reset controller
  2002.         r       read controller hardware status
  2003.                  bit 7-6 = 0
  2004.                  bit 5        logical unit number
  2005.                  bit 4-2 = 0
  2006.                  bit 1   = 0  no error
  2007.                  bit 0   = 0 
  2008.  
  2009. 0322    r       read DIPswitch setting on XT controller card
  2010.         w       generate controller-select pulse
  2011. 0323    w       write pattern to DMA and INT mask register
  2012.  
  2013. 0324-0327 ----  XT HDC 2   (Hard Disk Controller)
  2014. 0328-032B ----  XT HDC 3   (Hard Disk Controller)
  2015. 032C-032F ----  XT HDC 4   (Hard Disk Controller)
  2016.  
  2017.  
  2018. 0330-0331 ----  MIDI interface
  2019.  
  2020.  
  2021. 0330-0333 ----  Adaptec 154xB/154xC SCSI adapter. default address.
  2022.                 alternate address at 0130, 0134, 0230, 0234 and 0334
  2023.  
  2024.  
  2025. 0330-033F ----  CompaQ SCSI adapter. alternate address at 0130
  2026.  
  2027.  
  2028. 0330-033F ----  Philips CD-ROM player CM50
  2029.  
  2030.  
  2031. 0334-0337 ----  Adaptec 154xB/154xC SCSI adapter.
  2032. 44
  2033.                 alternate address at 0130, 0134, 0230 ,0234 and 0330
  2034.  
  2035.  
  2036. 0338      ----  AdLib soundblaster card
  2037.  
  2038.  
  2039. 0340-034F ----  Philips CD-ROM player CM50
  2040.  
  2041.  
  2042. 0340-034F ----  SCSI (1st Small Computer System Interface) adapter
  2043.                 (alternate at 0140-014F)
  2044.  
  2045.  
  2046. 0340-0357 ----  RTC (1st Real Time Clock for XT), (alternate at 0240-0257)
  2047.                 (used by TIMER.COM v1.2 which is the 'standard' timer program)
  2048.  
  2049. 0340    r/w     0.01 seconds  0-99
  2050. 0341    r/w     0.1 seconds   0-99
  2051. 0342    r/w     seconds       0-59
  2052. 0343    r/w     minutes       0-59
  2053. 0343    r/w     hours         0-23
  2054. 0345    r/w     day of week   1-7
  2055. 0346    r/w     day of month  1-31
  2056. 0347    r/w     month         1-12
  2057. 0348
  2058. 0349    r/w     year          0-99
  2059. 034A
  2060. 034B
  2061. 034C
  2062. 034D
  2063. 034E
  2064. 034F
  2065. 0350    r       status?
  2066. 0351    
  2067. 0352
  2068. 0353
  2069. 0354    r       status?
  2070. 0355
  2071. 0356
  2072. 0357
  2073.  
  2074.  
  2075. 0348-0357 ----  DCA 3278
  2076.  
  2077.  
  2078. 0360-036F ----  PC network (AT)
  2079. 0360-0367 ----  PC network (XT only)
  2080.  
  2081.  
  2082. 45
  2083. 0370-0377 ----  FDC 2  (2nd Floppy Disk Controller 8272)  same as 03F0
  2084.  
  2085. 0372    w       diskette controller DOR (Digital Output Register)
  2086. 0374    r       diskette controller status register
  2087. 0375    r/w     diskette controller data register
  2088. 0376    r/w     FIXED disk controller data register
  2089. 0377    r       diskette controller DIR (Digital Input Register)
  2090. 0377    w       select register for diskette data transfer rate
  2091.  
  2092.  
  2093. 0378-037A ----  parallel printer port, same as 0278 and 03BC
  2094.  
  2095. 0378    w       data port
  2096. 0379    r/w     status port
  2097. 037A    r/w     control port
  2098.  
  2099.  
  2100. 0380-038F ----  2nd Binary Synchronous Data Link Control adapter (see 03A0)
  2101.  
  2102. 0380    r/w      on board 8255 port A, internal/external sense
  2103. 0381    r/w      on board 8255 port B, external modem interface
  2104. 0382    r/w      on board 8255 port C, internal control and gating
  2105. 0383    r/w      on board 8255 mode register
  2106. 0384    r/w      on board 8253 channel square wave generator
  2107. 0385    r/w      on board 8253 channel 1 inactivity time-out
  2108. 0386    r/w      on board 8253 channel 2 inactivity time-out
  2109. 0387    r/w      on board 8253 mode register
  2110. 0388    r/w      on board 8273 read: status  write: command
  2111. 0389    r/w      on board 8273 read: response  write: parameter
  2112. 038A    r/w      on board 8273 transmit interrupt status
  2113. 038B    r/w      on board 8273 receiver interrupt status
  2114. 038C    r/w      on board 8273 data
  2115.  
  2116.  
  2117. 0388-0389 ---- Soundblaster PRO FM-Chip
  2118. 0388-038B ---- Soundblaster 16 ASP FM-Chip
  2119.  
  2120.  
  2121. 0390-039F ----  Cluster adapter (AT)
  2122.  
  2123. 0390-0393       (adapter 0)     (XT)
  2124.  
  2125.  
  2126. 46
  2127. 03A0-03AF ----  1st SDLC (Binary Synchronous Data Link Control adapter)
  2128.  
  2129. 0380    r/w      on board 8255 port A, internal/external sense
  2130. 0381    r/w      on board 8255 port B, external modem interface
  2131. 0382    r/w      on board 8255 port C, internal control and gating
  2132. 0383    r/w      on board 8255 mode register
  2133. 0384    r/w      on board 8253 counter 0 unused
  2134. 0385    r/w      on board 8253 channel 1 inactivity time-out
  2135. 0386    r/w      on board 8253 channel 2 inactivity time-out
  2136. 0387    r/w      on board 8253 mode register
  2137. 0388    r/w      on board 8251 data
  2138. 0389    r/w      on board 8251 command/mode/status register
  2139.  
  2140.  
  2141. 03B0-03BF ----  MDA  (Monochrome Display Adapter based on 6845)
  2142.  
  2143. 03B0            same as 03B4
  2144. 03B1            same as 03B5
  2145. 03B2            same as 03B4
  2146. 03B3            same as 03B5
  2147. 03B4    w       MDA CRT index register   (EGA/VGA)
  2148.                 selects which register (0-11h) is to be accessed through 3B5
  2149. 03B5    r/w     MDA CRT data register    (EGA/VGA)
  2150.                 selected by port 3B4. registers C-F may be read
  2151.                  00  horizontal total
  2152.                  01  horizontal displayed
  2153.                  02  horizontal sync position
  2154.                  03  horizontal sync pulse width
  2155.                  04  vertical total
  2156.                  05  vertical displayed
  2157.                  06  vertical sync position
  2158.                  07  vertical sunc pulse width
  2159.                  08  interlace mode
  2160.                  09  maximum scan lines
  2161.                  0A  cursor start
  2162.                  0B  cursor end
  2163.                  0C  start address high
  2164.                  0D  start address low
  2165.                  0E  cursor location high
  2166.                  0F  cursor location low
  2167.                  10  light pen high
  2168.                  11  light pen low
  2169. 03B6            same as 03B4
  2170. 03B7            same as 03B5
  2171. 03B8    r/w     MDA mode control register
  2172.                  bit 7 not used
  2173.                  bit 6 not used
  2174.                  bit 5 enable blink
  2175.                  bit 4 not used
  2176.                  bit 3 video enable
  2177.                  bit 2 not used
  2178.                  bit 1 not used
  2179.                  bit 0 high resolution mode
  2180.  
  2181. 03B9            reserved for color select register on color adapter
  2182.  
  2183. 03BA    r       CRT status register      EGA/VGA: input status 1 register
  2184.                  bit 7-4 reserved
  2185.                  bit 3   black/white video
  2186.                  bit 2-1 reserved
  2187. 47
  2188.                  bit 0   horizontal drive
  2189.  
  2190.                  bit 7   (MSD says) if this bit changes within 8000h reads then
  2191.                  bit 6-4 = 000 adapter is Hercules or compatible
  2192.                          = 001 adapter is Hercules+
  2193.                          = 101 adapter is Hercules InColor
  2194.                          else  adapter is unknown
  2195.  
  2196. 03BA    w       EGA/VGA feature control register
  2197.  
  2198. 03BB            reserved for light pen strobe reset
  2199.  
  2200.  
  2201. 03BC-03BF ----  parallel printer port, same as 0278 and 0378
  2202.  
  2203. 03BC    w       data port
  2204. 03BD    r/w     status port
  2205.                  bit 7 = 0  busy
  2206.                  bit 6 = 0  acknowledge
  2207.                  bit 5 = 1  out of paper
  2208.                  bit 4 = 1  printer is selected
  2209.                  bit 3 = 0  error
  2210.                  bit 2 = 0  IRQ has occurred
  2211.                  bit 1-0    reserved
  2212.  
  2213. 03BE    r/w     control port
  2214.                  bit 7-5    reserved
  2215.                  bit 4 = 1  enable IRQ
  2216.                  bit 3 = 1  select printer
  2217.                  bit 2 = 0  initialize printer
  2218.                  bit 1 = 1  automatic line feed
  2219.                  bit 0 = 1  strobe
  2220.  
  2221.  
  2222. 03BF    r/w     Hercules configuration switch register
  2223.                  bit 7-2
  2224.                  bit 1 = 0  disables upper 32K of graphics mode buffer
  2225.                          1  enables upper 32K of graphics mode buffer
  2226.                  bit 0 = 0  prevents graphics mode
  2227.                          1  allows graphics mode
  2228.  
  2229.  
  2230. 48
  2231. 03C0-03CF ----  EGA  (1st Enhanced Graphics Adapter)    alternate at 02C0
  2232.  
  2233. 03C0    (r)/w   EGA VGA ATC index/data register
  2234. 03C1    r       VGA     other attribute register
  2235. 03C2    r       EGA VGA input status 0 register
  2236.         w       VGA     miscellaneous output register
  2237. 03C3    r/w     VGA     video subsystem enable
  2238. 03C4    w       EGA     TS index register
  2239.         r/w     VGA     sequencer index register
  2240. 03C5    w       EGA     TS data register
  2241.         r/w     VGA     other sequencer register
  2242. 03C6    r/w     VGA     PEL mask register
  2243. 03C7    r/w     VGA     PEL address read mode
  2244.         r       VGA     DAC state register
  2245. 03C8    r/w     VGA     PEL address write mode
  2246. 03C9    r/w     VGA     PEL data register
  2247. 03CA    w       EGA     graphics 2 position register
  2248.         r       VGA     feature control register
  2249. 03CC    w       EGA     graphics 1 position register
  2250.         r       VGA     miscellaneous output register
  2251. 03CE    w       EGA     GDC index register
  2252.         r/w     VGA     graphics address register
  2253. 03CF    w       EGA     GDC data register
  2254.         r/w     VGA     other graphics register
  2255.  
  2256.  
  2257. 03D0-03DF ----  CGA   (Color Graphics Adapter)
  2258.  
  2259. 03D0            same as 03D4
  2260. 03D1            same as 03D5
  2261. 03D2            same as 03D4
  2262. 03D3            same as 03D5
  2263. 03D4    w       CRT (6845) index register   (EGA/VGA)
  2264.                 selects which register (0-11h) is to be accessed through 3B5
  2265. 03D5    w       CRT (6845) data register    (EGA/VGA)
  2266.                 selected by port 3B4. registers C-F may be read
  2267.                  (for registers see at 3B5)
  2268. 03D6            same as 03D4
  2269. 03D7            same as 03D5
  2270. 03D8    r/w     CGA mode control register  (except PCjr)
  2271.                  bit 7-6      not used
  2272.                  bit 5   = 1  blink enabled
  2273.                  bit 4   = 1  640*200 graphics mode
  2274.                  bit 3   = 1  video enabled
  2275.                  bit 2   = 1  monochrome signal
  2276.                  bit 1   = 0  text mode
  2277.                          = 1  320*200 graphics mode
  2278.                  bit 0   = 0  40*25 text mode
  2279.                          = 1  80*25 text mode
  2280.  
  2281. 49
  2282. 03D9    r/w     CGA palette register
  2283.                  bit 7-6      not used
  2284.                  bit 5   = 0 active color set: red, green brown
  2285.                          = 1 active color set: cyan, magenta, white
  2286.                  bit 4       intense colors in graphics, background colors text
  2287.                  bit 3       intense border in 40*25, intense background in
  2288.                              320*200, intense foreground in 640*200
  2289.                  bit 2       red border in 40*25, red background in 320*200,
  2290.                              red foreground in 640*200
  2291.                  bit 1       green border in 40*25, green background in
  2292.                              320*200, green foreground in 640*200
  2293.                  bit 0       blue border in 40*25, blue background in 320*200,
  2294.                              blue foreground in 640*200
  2295.  
  2296. 03DA    r       CGA status register     EGA/VGA: input status 1 register
  2297.                  bit 7-4     not used
  2298.                  bit 3 = 1   in vertical retrace
  2299.                  bit 2 = 1   light pen switch is off
  2300.                  bit 1 = 1   positive edge from light pen has set trigger
  2301.                  bit 0 = 0   do not use memory
  2302.                        = 1   memory access without interfering with display
  2303.  
  2304. 03DA    w       EGA/VGA feature control register
  2305.  
  2306. 03DB    w       clear light pen latch
  2307. 03DC    r/w     preset licht pen latch
  2308.  
  2309. 03DF            CRT/CPU page register  PCjr only
  2310.  
  2311.  
  2312. 03E8-03EF ----  serial port, same as 02E8, 02F8, and 03F8
  2313.  
  2314.  
  2315. 03F0-03F7 ----  FDC 1  (1st Floppy Disk Controller 8272)  same as 0370
  2316.  
  2317. 03F0            diskette controller status A (PS/2)
  2318.                  bit 7   interrupt pending
  2319.                  bit 6   second drive installed
  2320.                  bit 5   step
  2321.                  bit 4   track 0
  2322.                  bit 3   head 1 select
  2323.                  bit 2   index
  2324.                  bit 1   write protect
  2325.                  bit 0   direction
  2326.  
  2327. 03F1    r       diskette controller status B (PS/2)
  2328.                  bit 7-6  reserved
  2329.                  bit 5    drive select (0=A:, 1=B:)
  2330.                  bit 4    write data
  2331.                  bit 3    read data
  2332.                  bit 2    write enable
  2333.                  bit 1    motor enable 1
  2334.                  bit 0    motor enable 0
  2335.  
  2336. 03F2    w       diskette controller DOR (Digital Output Register)
  2337.                  bit 7-6    reserved PS/2
  2338.                  bit 7 = 1  drive 3 motor enable
  2339.                  bit 6 = 1  drive 2 motor enable
  2340.                  bit 5 = 1  drive 1 motor enable
  2341.                  bit 4 = 1  drive 0 motor enable
  2342. 50
  2343.                  bit 3 = 1  diskette DMA enable (reserved PS/2)
  2344.                  bit 2 = 1  FDC enable  (controller reset)
  2345.                        = 0  hold FDC at reset
  2346.                  bit 1-0    drive select (0=A 1=B ..)
  2347.  
  2348. 03F4    r       diskette controller status register
  2349.                  bit 7 = 1  data register is ready
  2350.                  bit 6 = 1  transfer is from controller to system
  2351.                          0  transfer is from system to controller
  2352.                  bit 5 = 1  non-DMA mode
  2353.                  bit 4 = 1  diskette controller busy
  2354.                  bit 3 = 1  drive 3 busy (reserved on PS/2)
  2355.                  bit 2 = 1  drive 2 busy (reserved on PS/2)
  2356.                  bit 1 = 1  drive 1 busy
  2357.                  bit 0 = 1  drive 0 busy
  2358.  
  2359. 03F5    r       diskette command status register 0
  2360.                  bit 7-6      last command status
  2361.                          = 00 command terminated successfully
  2362.                          = 01 command terminated abnormally
  2363.                          = 10 invalid command
  2364.                          = 11 terminated abnormally by change in ready signal
  2365.                  bit 5   = 1  seek completed
  2366.                  bit 4   = 1  equipment check occurred after error
  2367.                  bit 3   = 1  not ready
  2368.                  bit 2   = 1  head number at interrupt
  2369.                  bit 1-0 = 1  unit select (0=A 1=B .. )
  2370.                               (on PS/2  01=A  10=B)
  2371.  
  2372.                 status register 1
  2373.                  bit 7      end of cylinder; sector# greater then sectors/track
  2374.                  bit 6 = 0
  2375.                  bit 5 = 1  CRC error in ID or data field
  2376.                  bit 4 = 1  overrun
  2377.                  bit 3 = 0
  2378.                  bit 2 = 1  sector ID not found
  2379.                  bit 1 = 1  write protect detected during write
  2380.                  bit 0 = 1  ID address mark not found
  2381.  
  2382.                 status register 2
  2383.                  bit 7 = 0
  2384.                  bit 6 = 1  deleted Data Eddress Mark detected
  2385.                  bit 5 = 1  CRC error in data
  2386.                  bit 4 = 1  wrong cylinder detected
  2387.                  bit 3 = 1  scan command equal condition satisfied
  2388.                  bit 2 = 1  scan command failed, sector not found
  2389.                  bit 1 = 1  bad cylinder, ID not found
  2390.                  bit 0 = 1  missing Data Address Mark 
  2391.  
  2392.                 status register 3
  2393.                  bit 7      fault status signal
  2394.                  bit 6      write protect status
  2395.                  bit 5      ready status
  2396.                  bit 4      track zero status
  2397.                  bit 3      two sided status signal
  2398.                  bit 2      side select (head select)
  2399.                  bit 1-0    unit select (0=A 1=B .. )
  2400.  
  2401. 03F6    r/w     FIXED disk controller data register
  2402.                  bit 7-4    reserved
  2403. 51
  2404.                  bit 3 = 0  reduce write current
  2405.                          1  head select 3 enable
  2406.                  bit 2 = 1  disk reset enable
  2407.                          0  disk reset disable
  2408.                  bit 1 = 0  disk initialization enable
  2409.                          1  disk initialization disable
  2410.                  bit 0      reserved
  2411.  
  2412. 03F7    r       diskette controller DIR (Digital Input Register)
  2413.                  bit 7 = 1 diskette change
  2414.  
  2415.                  bit 6     FIXED DISK write gate
  2416.                  bit 5     FIXED DISK head select 3 / reduced write current
  2417.                  bit 4     FIXED DISK head select 2
  2418.                  bit 3     FIXED DISK head select 1
  2419.                  bit 2     FIXED DISK head select 0
  2420.                  bit 1     FIXED DISK drive 1 select
  2421.                  bit 0     FIXED DISK drive 0 select   conflicts with:
  2422.  
  2423.                  bit 0     diskette high density select
  2424.  
  2425. 03F7    w       select register for diskette data transfer rate
  2426.                  bit 7-2       reserved
  2427.                  bit 1-0 = 00  500 Kb/S mode
  2428.                          = 01  300 Kb/S mode
  2429.                          = 10  250 Kb/S mode
  2430.                          = 11  reserved
  2431.  
  2432.  
  2433. 03F8-03FF ----  serial port (8250,8251,16450,16550), same as 02E8,02F8,and 03F8
  2434.  
  2435. 03F8    w       serial port, transmitter holding register, which contains the
  2436.                 character to be sent. Bit 0 is sent first.
  2437.                  bit 7-0   data bits when DLAB=0 (Divisor Latch Access Bit)
  2438.         r       receiver buffer register, which contains the received character
  2439.                 Bit 0 is received first
  2440.                  bit 7-0   data bits when DLAB=0 (Divisor Latch Access Bit)
  2441.         r/w     divisor latch low byte when DLAB=1
  2442.  
  2443. 52
  2444. 03F9    r/w     divisor latch high byte when DLAB=1
  2445.         r/w     interrupt enable register when DLAB=0
  2446.                  bits 7-4   reserved
  2447.                  bit 3 = 1  modem-status interrupt enable
  2448.                  bit 2 = 1  receiver-line-status interrupt enable
  2449.                  bit 1 = 1  transmitter-holding-register empty interrupt enable
  2450.                  bit 0 = 1  received-data-avail.int. enable (and 16550 timeout)
  2451.  
  2452.               - 16550 will interrupt if data exists in the FIFO and isn't read
  2453.                 within the time it takes to receive four bytes or if no data is
  2454.                 received within the time it takes to receive four bytes
  2455.  
  2456. 03FA    r       interrupt identification register. Information about a pending
  2457.                 interrupt is stored here. When the ID register is addressed,
  2458.                 the highest priority interrupt is held, and no other interrupts
  2459.                 are acknowledged until the CPU services that interrupt.
  2460.                  bit 7-6 = 00  reserved on 8250, 8251, 16450
  2461.                          = 11  if FIFO queues are enabled (16550 only)
  2462.                  bit 5-4 = 0 reserved
  2463.                  bit 3   = 0 reserved  8250, 16450
  2464.                          = 1 16550  timeout int. pending
  2465.                  bit 2-1 identify pending interrupt with the highest priority
  2466.                          = 11  receiver line status interrupt. 
  2467.                                priority = highest
  2468.                          = 10  received data available register interrupt. 
  2469.                                priority = second 
  2470.                          = 01  transmitter holding register empty interrupt. 
  2471.                                priority = third 
  2472.                          = 00  modem status interrupt. 
  2473.                                priority = fourth
  2474.                  bit 0   = 0   interrupt pending. Contents of register can be 
  2475.                                used as a pointer to the appropriate 
  2476.                                interrupt service routine 
  2477.                          = 1   no interrupt pending
  2478.  
  2479.              - interrupt pending flag uses reverse logic, 0 = pending, 1 = none
  2480.              - interrupt will occur if any of the line status bits are set
  2481.              - THRE bit is set when THRE register is emptied into the TSR
  2482.  
  2483.  
  2484. 53
  2485. 03FA    w       16650 FCR  (FIFO Control Register)
  2486.                  bit 7-6 = 00  1 byte
  2487.                          = 01  4 bytes
  2488.                          = 10  8 bytes
  2489.                          = 11 14 bytes
  2490.                  bit 5-4 = 00 reserved
  2491.                  bit 3   = 1  change RXRDY  TXRDY pins from mode 0 to mode 1
  2492.                  bit 2   = 1  clear XMIT FIFO
  2493.                  bit 1   = 1  clear RCVR FIFO
  2494.                  bit 0   = 1  enable clear XMIT and RCVR FIFO queues
  2495.  
  2496.               - bit 0 must be set in order to write to other FCR bits
  2497.               - bit 1 when set  the RCVR FIFO is cleared and this bit is reset
  2498.                 the receiver shift register is not cleared
  2499.               - bit 2 when set  the XMIT FIFO is cleared and this bit is reset
  2500.                 the transmit shift register is not cleared
  2501.  
  2502. 03FB    r/w     line control register
  2503.                  bit 7 = 1  divisor latch access bit (DLAB)
  2504.                          0  receiver buffer, transmitter holding, or interrupt
  2505.                             enable register access
  2506.                  bit 6 = 1  set break enable. serial ouput is forced to spacing
  2507.                             state and remains there.
  2508.                  bit 5 =    stick parity
  2509.                  bit 4 = 1  even parity select
  2510.                  bit 3 =    parity enable
  2511.                          1  even number of ones are sent and checked in the 
  2512.                             data word bits and parity bit
  2513.                          0  odd number of ones are sent and checked
  2514.                  bit 2 = 0  one stop bit
  2515.                          1  zero stop bit
  2516.                  bit 1-0 00 word length is 5 bits
  2517.                          01 word length is 6 bits
  2518.                          10 word length is 7 bits
  2519.                          11 word length is 8 bits
  2520.  
  2521. 03FC    r/w     modem control register
  2522.                  bit 7-5 = 0  reserved
  2523.                  bit 4 = 1  loopback mode for diagnostic testing of serial port
  2524.                             output of transmitter shift register is looped back
  2525.                             to receiver shift register input. In this mode
  2526.                             transmitted data is received immediately so that
  2527.                             the CPU can verify the transmit data/receive data
  2528.                             serial port paths.
  2529.                  bit 3 = 1  auxiliary user-designated output 2
  2530.                  bit 2 = 1  auxiliary user-designated output 1
  2531.                  bit 1 = 1  force request-to-send active
  2532.                  bit 0 = 1  force data-terminal-ready active
  2533.  
  2534. 54
  2535. 03FD    r       line status register
  2536.                  bit 7 = 0  reserved
  2537.                  bit 6 = 1  transmitter shift and holding registers empty
  2538.                  bit 5 = 1  transmitter holding register empty. Controller is
  2539.                             ready toaccept a new character to send.
  2540.                  bit 4 = 1  break interrupt. the received data input is held in
  2541.                             in the zero bit state longer than the time of start
  2542.                             bit + data bits + parity bit + stop bits.
  2543.                  bit 3 = 1  framing error. the stop bit that follows the last
  2544.                             parity or data bit is a zero bit.
  2545.                  bit 2 = 1  parity error. Character has wrong parity
  2546.                  bit 1 = 1  overrun error. a character was sent to the receiver
  2547.                             buffer before the previous character in the buffer
  2548.                             could be read. This destroys the previous
  2549.                             character.
  2550.                  bit 0 = 1  data ready. a complete incoming character has been
  2551.                             received and sent to the receiver buffer register.
  2552.  
  2553. 03FE    r       modem status register
  2554.                  bit 7 = 1  data carrier detect
  2555.                  bit 6 = 1  ring indicator
  2556.                  bit 5 = 1  data set ready
  2557.                  bit 4 = 1  clear to send
  2558.                  bit 3 = 1  delta data carrier detect
  2559.                  bit 2 = 1  trailing edge ring indicator
  2560.                  bit 1 = 1  delta data set ready
  2561.                  bit 0 = 1  delta clear to send
  2562.  
  2563.               - bits 0-3 are reset when the CPU reads the MSR
  2564.               - bit 4 is the Modem Control Register RTS during loopback test
  2565.               - bit 5 is the Modem Control Register DTR during loopback test
  2566.               - bit 6 is the Modem Control Register OUT1 during loopback test
  2567.               - bit 7 is the Modem Control Register OUT2 during loopback test
  2568.  
  2569. 03FF    r/w     scratch register
  2570.  
  2571. Adresses above 03FF apply to EISA machines only
  2572.  
  2573.                          1000-1FFF      slot 1 EISA
  2574.                          2000-2FFF      slot 2 EISA
  2575.                          3000-3FFF      slot 3 EISA
  2576.                          4000-4FFF      slot 4 EISA
  2577.                          5000-5FFF      slot 5 EISA
  2578.                          6000-6FFF      slot 6 EISA
  2579.                          7000-7FFF      slot 7 EISA
  2580.  
  2581.  
  2582. 0401-04D6 ----  used by EISA systems only
  2583.  
  2584. 0401    r/w     DMA channel 0 word count byte 2 (high)
  2585. 0403    r/w     DMA channel 1 word count byte 2 (high)
  2586. 0405    r/w     DMA channel 2 word count byte 2 (high)
  2587. 0407    r/w     DMA channel 3 word count byte 2 (high)
  2588.  
  2589. 040A    w       extended DMA chaining mode register, channels 0-3
  2590.                  bit 7-5      reserved
  2591.                  bit 4   = 0  generates IRQ13
  2592.                          = 1  generates terminal count
  2593.                  bit 3   = 0  do not start chaining
  2594.                          = 1  programming complete
  2595. 55
  2596.                  bit 2   = 0  disable buffer chaining mode (default)
  2597.                          = 1  enable buffer chaining mode
  2598.                  bit 1-0      DMA channel select
  2599.  
  2600. 040A    r       channel interrupt (IRQ13) status register
  2601.                  bit 7-5  interrupt on channels 7-5
  2602.                  bit 4    reserved
  2603.                  bit 3-0  interrupt on channels 3-0
  2604.  
  2605. 040B    w       DMA extended mode register for channels 3-0.
  2606.                 bit settings same as 04D6
  2607.                  bit 7   = 0  enable stop register
  2608.                  bit 6   = 0  terminal count is an output for this channel
  2609. (default)
  2610.                  bit 5-4      DMA cycle timing
  2611.                          = 00 ISA-compatible (default)
  2612.                          = 01 type A timing mode
  2613.                          = 10 type B timing mode
  2614.                          = 11 burst DMA mode
  2615.                  bit 3-2      Address mode
  2616.                          = 00 8-bit I/O, count by bytes (default)
  2617.                          = 01 16-bit I/O, count by words, address shifted
  2618.                          = 10 32-bit I/O, count by bytes
  2619.                          = 11 16-bit I/O, count by bytes
  2620.                  bit 1-0      DMA channel select
  2621.  
  2622.  
  2623. 0461    r/w     Extended NMI status/control register
  2624.                  bit 7 = 1  NMI pending from fail-safe timer (read only)
  2625.                  bit 6 = 1  NMI pending from bus timeout NMI status (read
  2626. only)
  2627.                  bit 5 = 1  NMI pending (read only)
  2628.                  bit 4      reserved
  2629.                  bit 3 = 1  bus timeout NMI enable (read/write)
  2630.                  bit 2 = 1  fail-safe NMI enable (read/write)
  2631.                  bit 1 = 1  NMI I/O port enable (read/write)
  2632.                  bit 0      RSTDRV. bus reset (read/write)
  2633.                        = 0  normal bus reset operation
  2634.                        = 1  reset bus asserted
  2635.  
  2636. 0462    w       Software NMI register. writing to this register causes an NMI
  2637.                 if NMI's are enabled
  2638.                  bit 7 = 1  generates an NMI
  2639.  
  2640. 56
  2641. 0464    r       bus master status latch register (slots 1-8). identifies the
  2642.                 last bus master that had control of the bus
  2643.                  bit 7 = 0  slot 8 had control last
  2644.                  bit 6 = 0  slot 7 had control last
  2645.                  bit 5 = 0  slot 6 had control last
  2646.                  bit 4 = 0  slot 5 had control last
  2647.                  bit 3 = 0  slot 4 had control last
  2648.                  bit 2 = 0  slot 3 had control last
  2649.                  bit 1 = 0  slot 2 had control last
  2650.                  bit 0 = 0  slot 1 had control last
  2651.  
  2652. 0465    r       bus master status latch register (slots 9-16)
  2653.                  bit 7 = 0  slot 16 had control last
  2654.                  bit 6 = 0  slot 15 had control last
  2655.                  bit 5 = 0  slot 14 had control last
  2656.                  bit 4 = 0  slot 13 had control last
  2657.                  bit 3 = 0  slot 12 had control last
  2658.                  bit 2 = 0  slot 11 had control last
  2659.                  bit 1 = 0  slot 10 had control last
  2660.                  bit 0 = 0  slot 9  had control last
  2661.  
  2662.  
  2663. 0481    r/w     DMA channel 2 address byte 3 (high)
  2664. 0482    r/w     DMA channel 3 address byte 3 (high)
  2665. 0483    r/w     DMA channel 1 address byte 3 (high)
  2666. 0487    r/w     DMA channel 0 address byte 3 (high)
  2667. 0489    r/w     DMA channel 6 address byte 3 (high)
  2668. 048A    r/w     DMA channel 7 address byte 3 (high)
  2669. 048B    r/w     DMA channel 5 address byte 3 (high)
  2670.  
  2671. 04C6    r/w     DMA channel 5 word count byte 2 (high)
  2672. 04CA    r/w     DMA channel 6 word count byte 2 (high)
  2673. 04CE    r/w     DMA channel 7 word count byte 2 (high)
  2674.  
  2675.  
  2676. 04D0    w       IRQ 0-7 interrupt edge/level registers
  2677.                  bit 7 = 1  IRQ 7 is level sensitive
  2678.                  bit 6 = 1  IRQ 6 is level sensitive
  2679.                  bit 5 = 1  IRQ 5 is level sensitive
  2680.                  bit 4 = 1  IRQ 4 is level sensitive
  2681.                  bit 3 = 1  IRQ 3 is level sensitive
  2682.                  bit 2-0    reserved
  2683.  
  2684. 04D1    w       IRQ 8-15 interrupt edge/level registers
  2685.                  bit 7 = 1  IRQ 15 is level sensitive
  2686.                  bit 6 = 1  IRQ 14 is level sensitive
  2687.                  bit 5 = 1  reserved
  2688.                  bit 4 = 1  IRQ 12 is level sensitive
  2689.                  bit 3 = 1  IRQ 11 is level sensitive
  2690.                  bit 2 = 1  IRQ 10 is level sensitive
  2691.                  bit 1 = 1  IRQ 9  is level sensitive
  2692.                  bit 0      reserved
  2693.  
  2694. 57
  2695. 04D4    w       extended DMA chaining mode register, channels 4-7
  2696.                  bit 7-5 = 0  reserved
  2697.                  bit 4   = 0  generates IRQ 13
  2698.                          = 1  generates terminal count
  2699.                  bit 3   = 0  do not start chaining
  2700.                          = 1  programming complete
  2701.                  bit 2   = 0  disable buffer chaining mode (default)
  2702.                          = 1  enable buffer chaining mode
  2703.                  bit 1-0      DMA channel select
  2704.  
  2705. 04D6    w       DMA extended mode register for channels 4-7
  2706.                 bit settings same as 04B
  2707.                  bit 7   = 0  enable stop register
  2708.                  bit 6   = 0  terminal count is an output for this channel
  2709. (default)
  2710.                  bit 5-4      DMA cycle timing
  2711.                          = 00 ISA-compatible (default)
  2712.                          = 01 type A timing mode
  2713.                          = 10 type B timing mode
  2714.                          = 11 burst DMA mode
  2715.                  bit 3-2      Address mode
  2716.                          = 00 8-bit I/O, count by bytes (default)
  2717.                          = 01 16-bit I/O, count by words, address shifted
  2718.                          = 10 32-bit I/O, count by bytes
  2719.                          = 11 16-bit I/O, count by bytes
  2720.                  bit 1-0      DMA channel select
  2721.  
  2722.  
  2723. 0601    w       System control. Laptop chipset: Headland HL21 & Acer M5105
  2724.                  bit 7 = 1  power led on
  2725.                  bit 6 = 1  LCD backlight off
  2726.                  bit 5
  2727.                  bit 4
  2728.                  bit 3
  2729.                  bit 2 = 1  video chips disabled, screen blanked.
  2730.                  bit 1
  2731.                  bit 0 = 1  will lock up your machine!
  2732.  
  2733.         r        =04        (always reads back this value)
  2734.  
  2735.  
  2736. 0620-0627 ----  PC network (adapter 1)
  2737. 0628-062F ----  PC network (adapter 2)
  2738.  
  2739.  
  2740. 06E2-06E3 ----  data aquisition (adapter 1)
  2741.  
  2742.  
  2743. 0790-0793 ----  cluster (adapter 1)
  2744.  
  2745.  
  2746. 0800-08FF ----  I/O port access registers for extended CMOS RAM or SRAM
  2747.                 (256 bytes at a time)
  2748.                 Sometimes plain text can be seen here.
  2749.  
  2750.  
  2751. 0A20-0A23 ----  Token Ring (adapter 1)
  2752. 0A24-0A27 ----  Token Ring (adapter 2)
  2753.  
  2754.  
  2755. 58
  2756. 0AE2-0AE3 ----  cluster (adapter 2)
  2757. 0B90-0B93 ----  cluster (adapter 2)
  2758.  
  2759.  
  2760. 0C00    r/w     page register to write to SRAM or I/O
  2761.  
  2762.  
  2763. 0C80-0C83 ----  system board ID registers
  2764.  
  2765.  
  2766. 1390-1393 ----  cluster (adapter 3)
  2767.  
  2768.  
  2769. 2100-210F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2770. 2110-211F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2771. 2120-212F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2772. 2130-213F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2773. 2140-214F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2774. 2150-215F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2775. 2160-216F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2776. 2170-217F ----  IBM XGA (eXtended Graphics Adapter  8514/A)
  2777.  
  2778.  
  2779. 2390-2393 ----  cluster (adapter 4)
  2780.  
  2781.  
  2782. 3220-3227 ----  serial port 3, description same as 03F8
  2783. 3228-322F ----  serial port 4, description same as 03F8
  2784.  
  2785.  
  2786. 3540-354F ----  IBM SCSI (Small Computer System Interface) adapter
  2787. 3550-355F ----  IBM SCSI (Small Computer System Interface) adapter
  2788. 3560-356F ----  IBM SCSI (Small Computer System Interface) adapter
  2789. 3570-357F ----  IBM SCSI (Small Computer System Interface) adapter
  2790.  
  2791.  
  2792. 4220-4227 ----  serial port, description same as 03F8
  2793. 4228-422F ----  serial port, description same as 03F8
  2794.  
  2795.  
  2796. 42E0-42EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2797.  
  2798. 42E1    r/w     GPIB (adapter 2)
  2799.  
  2800.  
  2801. 5220-5227 ----  serial port, description same as 03F8
  2802. 5228-522F ----  serial port, description same as 03F8
  2803.  
  2804.  
  2805. 62E0-62EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2806.  
  2807. 62E1    r/w     GPIB (adapter 3)
  2808.  
  2809.  
  2810. 82E0-82EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2811.  
  2812. 82E1    r/w     GPIB (adapter 4)
  2813.  
  2814.  
  2815. 82F8-82FF ----  serial port, description same as 03F8
  2816. 59
  2817. 83F8-83FF ----  serial port, description same as 03F8
  2818.  
  2819.  
  2820. A220      ????  soundblaster support in AMI Hi-Flex BIOS  ????
  2821.  
  2822.  
  2823. A2E0-A2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2824.  
  2825. A2E1    r/w     GPIB (adapter 5)
  2826.  
  2827.  
  2828. AFFF    r/w     plane 0-3 system latch (video register)
  2829.  
  2830.  
  2831. B220-B227 ----  serial port, description same as 03F8
  2832. B228-B22F ----  serial port, description same as 03F8
  2833.  
  2834.  
  2835. C220-C227 ----  serial port, description same as 03F8
  2836. C228-C22F ----  serial port, description same as 03F8
  2837.  
  2838.  
  2839. D220-D227 ----  serial port, description same as 03F8
  2840. D228-D22F ----  serial port, description same as 03F8
  2841.  
  2842.  
  2843. C2E0-C2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2844.  
  2845. C2E1    r/w     GPIB (adapter 6)
  2846.  
  2847.  
  2848. E2E0-E2EF ----  GPIB (General Purpose Interface Bus, IEEE 488 interface)
  2849.  
  2850. E2E1    r/w     GPIB (adapter 7)
  2851.  
  2852.  
  2853.  
  2854.  
  2855.                             MEMORY-MAPPED ADDRESSES
  2856.  
  2857.  
  2858. 80C00000  Compaq Deskpro 386 system memory board register
  2859.  
  2860. 60
  2861. 80C00000 w      RAM relocation register
  2862.                 bit 7-2    Reserved, always write 1's.
  2863.                 bit 1 = 0  Write-protect 128-Kbyte RAM at FE0000.
  2864.                       = 1  Do not write-protect RAM at FE0000.
  2865.                 bit 0 = 0  Relocate 128-Kbyte block at FE0000 to address 0E0000
  2866.                       = 1  128-Kbyte RAM is addressed only at FE0000.
  2867.  
  2868. 80C00000 r      Diagnostics register
  2869.                 bit 7   = 0  memory expansion board is installed
  2870.                 bit 6   = 0  second 1 MB of system memory board is installed
  2871.                 bit 5-4 = 00 base memory set to 640 KB
  2872.                         = 01 invalid
  2873.                         = 10 base memory set to 512 KB
  2874.                         = 11 base memory set to 256 KB
  2875.                 bit 3   = 0  parity error in byte 3
  2876.                 bit 2   = 0  parity error in byte 2
  2877.                 bit 1   = 0  parity error in byte 1
  2878.                 bit 0   = 0  parity error in byte 0 (in 32-bit double word)
  2879. 61
  2880.                      Program Segment Prefix Data Structure
  2881.  
  2882.  
  2883. When DOS loads a program for execution it creates a data structure in memory 
  2884. called the "Program Segment Prefix", or PSP for short. This structure occupies 
  2885. the 256 bytes of memory immediately preceeding the memory occupied by the 
  2886. loaded program. The PSP contains useful information which is often accessed by 
  2887. the running program. The following table describes the structure of the PSP.
  2888.  
  2889.  
  2890.  
  2891. Offset   Description
  2892.  
  2893.  00      INT 20 instruction for CP/M CALL 0 program termination
  2894.  02      segment of first byte beyond memory allocated to program
  2895.  04      unused filler
  2896.  05      CP/M CALL 5 service request (FAR JMP to 000C0h)
  2897.          BUG: (DOS 2+) PSPs created by INT 21/AH=4B point at 000BE
  2898.  06      CP/M compatibility - size of first segment for .COM files
  2899.  08      remainder of FAR JMP at 05
  2900.  0A      stored INT 22 termination address
  2901.  0E      stored INT 23 control-Break handler address
  2902.  12      DOS 1.1+ stored INT 24 critical error handler address
  2903.  16      segment of parent PSP
  2904.  18      DOS 2+ Job File Table, one byte per file handle, FFh = closed
  2905.  2C      DOS 2+ segment of environment for process
  2906.  2E      DOS 2+ process's SS:SP on entry to last INT 21 call
  2907.  32      DOS 3+ number of entries in JFT (default 20)
  2908.  34      DOS 3+ pointer to JFT (default PSP:0018)
  2909.  38      DOS 3+ pointer to previous PSP (default FFFFFFFFh in 3.x)
  2910.          used by SHARE in DOS 3.3
  2911.  3C      apparently unused by DOS versions <= 6.00
  2912.  3D      (APPEND) TrueName flag 
  2913.  3E      (Novell NetWare) flag: next byte initialized if CEh
  2914.  3F      (Novell NetWare) Novell task number if previous byte is CEh
  2915.  40      DOS 5+ version to return on INT 21/AH=30
  2916.  42      (MSWindows3) selector of next PSP (PDB) in linked list
  2917.          Windows keeps a linked list of Windows programs only
  2918.  44      unused by DOS versions <= 6.00
  2919.  48      (MSWindows3) bit 0 set if non-Windows application (WINOLDAP)
  2920.  49      unused by DOS versions <= 6.00
  2921.  50      DOS 2+ service request (INT 21/RETF instructions)
  2922.  53      unused in DOS versions <= 6.00
  2923.  55      unused in DOS versions <= 6.00; can be used to make first FCB
  2924.          into an extended FCB
  2925.  5C      first default FCB, filled in from first command tail argument
  2926.          overwrites second FCB if opened
  2927.  6C      second default FCB, filled in from second command tail argument
  2928.          overwrites beginning of command tail if opened
  2929.  7C      unused
  2930.  80      Length of command tail
  2931.  81      Command tail terminated by 0D
  2932.  
  2933. 62
  2934.                                     CREDITS
  2935.  
  2936.  
  2937.  
  2938. The following publications have proved useful in the production of SSD:
  2939.  
  2940.  
  2941. 8086/8088 User's Manual, Intel 1989
  2942.  
  2943. PC Intern, Michael Tischer, Abacus 1992
  2944.  
  2945. DOS Programmer's Reference, Terry R Dettmann, Que 1988
  2946.  
  2947. Interrupt List edited by Ralf Brown. Including details of the multiplex 
  2948. interrupt, described by Robin Walker.
  2949.  
  2950.  
  2951. The author is grateful to the cooperation of the virus writer "Black Baron" 
  2952. (Chris Pile) in supplying copies of his polymorphic computer viruses and 
  2953. supplying information about the SMEG engine. As well as testing early versions 
  2954. of SSD against his own polymorphic viruses. Thanks Chris! 
  2955.  
  2956. 63
  2957. Program Design & Coding: Matthew Probert
  2958.  
  2959. Version 4.0 published by Servile Software April 1996. All rights reserved.
  2960.  
  2961. With effect from version 2.4, SSD became SHAREWARE and you are required to 
  2962. register your copy or stop using it.
  2963.  
  2964. Registration costs 29.95 pounds sterling (UK pounds).
  2965.  
  2966. Please make cheques payable to "M. Probert" ONLY, and send with the enclosed 
  2967. order form (order.doc) to:
  2968.  
  2969. Matthew Probert
  2970. 5 Longcroft Close
  2971. Basinsgtoke
  2972. Hampshire
  2973. RG21 8XG
  2974.  
  2975. Telephone +44 (0)1256 414072
  2976.  
  2977.